Skip to content

Commit

Permalink
help github
Browse files Browse the repository at this point in the history
  • Loading branch information
bangtoven committed Nov 14, 2023
1 parent 4e01333 commit b037004
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/wallet-sdk/src/connection/WalletLinkConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export class WalletLinkConnection implements WalletLinkWebSocketUpdateListener {
* ConnectionState.CONNECTING is used for logging only
* TODO: Revisit if the logging is necessary. If not, deprecate the enum and use boolean instead.
*/
websocketConnectionStateUpdated = (state: ConnectionState) => {
websocketConnectionStateUpdated = async (state: ConnectionState) => {
this.diagnostic?.log(EVENTS.CONNECTED_STATE_CHANGE, {
state,
sessionIdHash: Session.hash(this.session.id),
Expand Down
12 changes: 6 additions & 6 deletions packages/wallet-sdk/src/connection/WalletLinkWebSocket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@ import {
} from './ServerMessage';
import { SessionConfig } from './SessionConfig';

export enum ConnectionState {
DISCONNECTED,
CONNECTING,
CONNECTED,
}

export interface WalletLinkWebSocketUpdateListener {
websocketConnectionStateUpdated(state: ConnectionState): void;
websocketLinkedUpdated(linked: boolean, message: Partial<ServerMessageIsLinkedOK>): void;
Expand All @@ -43,6 +37,12 @@ interface WalletLinkWebSocketParams {
WebSocketClass?: typeof WebSocket;
}

export enum ConnectionState {
DISCONNECTED,
CONNECTING,
CONNECTED,
}

const REQUEST_TIMEOUT = 60000;
const HEARTBEAT_INTERVAL = 10000;

Expand Down

0 comments on commit b037004

Please sign in to comment.