Skip to content

Commit

Permalink
Merge pull request #229 from tonkeeper/fix-default-returnStrategy
Browse files Browse the repository at this point in the history
fix default returnStrategy
  • Loading branch information
MariaBit authored Jan 24, 2023
2 parents f86ab74 + e82d0ba commit 5ff02dc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/tonconnect/TonConnectRemoteBridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class TonConnectRemoteBridgeService {

private origin: DeeplinkOrigin | null = null;

private returnStrategy: ReturnStrategy = null;
private returnStrategy: ReturnStrategy = 'back';

public setOrigin(origin: DeeplinkOrigin) {
this.origin = origin;
Expand Down Expand Up @@ -209,7 +209,7 @@ class TonConnectRemoteBridgeService {
if (this.origin === DeeplinkOrigin.DEEPLINK) {
if (this.returnStrategy === 'back') {
Minimizer.goBack();
} else if (this.returnStrategy !== null && this.returnStrategy !== 'none') {
} else if (this.returnStrategy !== 'none') {
const url = this.returnStrategy;

Linking.openURL(url).catch((error) =>
Expand All @@ -219,7 +219,7 @@ class TonConnectRemoteBridgeService {
}

this.origin = null;
this.returnStrategy = null;
this.returnStrategy = 'back';
}

async handleConnectDeeplink(query: IConnectQrQuery) {
Expand Down
2 changes: 1 addition & 1 deletion src/tonconnect/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ export interface DAppManifest {
privacyPolicyUrl?: string;
}

export type ReturnStrategy = 'back' | 'none' | string | null;
export type ReturnStrategy = 'back' | 'none' | string;

0 comments on commit 5ff02dc

Please sign in to comment.