Skip to content

Commit

Permalink
remove delay func
Browse files Browse the repository at this point in the history
  • Loading branch information
bangtoven committed Sep 29, 2023
1 parent 8772f2b commit 977d9b0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
5 changes: 2 additions & 3 deletions packages/wallet-sdk/src/connection/WalletLinkConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { filter, map, take, timeoutWith } from 'rxjs/operators';

import { Session } from '../relay/Session';
import { IntNumber } from '../types';
import { delay } from '../util';
import {
ClientMessage,
ClientMessageGetSessionConfig,
Expand Down Expand Up @@ -96,7 +95,7 @@ export class WalletLinkConnection {
if (!this.destroyed) {
const reconnect = async () => {
// wait 5 seconds
await delay(5000);
await new Promise((resolve) => setTimeout(resolve, 5000));
// check whether it's destroyed again
if (!this.destroyed) {
try {
Expand Down Expand Up @@ -291,7 +290,7 @@ export class WalletLinkConnection {

public async checkUnseenEvents() {
await this.onceConnected$;
await delay(250);
await new Promise((resolve) => setTimeout(resolve, 250));
try {
await this.fetchUnseenEventsAPI();
} catch (e) {
Expand Down
4 changes: 0 additions & 4 deletions packages/wallet-sdk/src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,3 @@ export function isMobileWeb(): boolean {
window?.navigator?.userAgent
);
}

export async function delay(time: number) {
await new Promise((resolve) => setTimeout(resolve, time));
}

0 comments on commit 977d9b0

Please sign in to comment.