Skip to content

Ln/fix gmail signup flow #311

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/app/auth/google/google.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ <h4 class="text--neutral-white">Save your recovery code</h4>
<div
class="margin-top--medium display--flex justify--between items--center flex--column--tablet gap--25--tablet"
>
>
<div class="section--seed__actions">
<button
(click)="copySeed()"
Expand Down
57 changes: 29 additions & 28 deletions src/app/auth/google/google.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,34 @@ export class GoogleComponent implements OnInit {
this.globalVars.accessLevelRequest
);

if (!this.globalVars.getFreeDeso) {
this.login(signedUp);
return;
}
if (!signedUp || !this.globalVars.getFreeDeso) {
this.backendApi
.GetUsersStateless([this.publicKey], true, true)
.subscribe((res) => {
if (res?.UserList?.length) {
if (res.UserList[0].BalanceNanos !== 0) {
this.login(signedUp);
return;
}
}
this.router.navigate(['/', RouteNames.GET_DESO], {
queryParams: { publicKey: this.publicKey, signedUp },
queryParamsHandling: 'merge',
});
});
} else {
this.router.navigate(['/', RouteNames.GET_DESO], {
queryParams: { publicKey: this.publicKey, signedUp },
queryParamsHandling: 'merge',
});
}
}

login(signedUp: boolean): void {
if (this.globalVars.derive) {
this.router.navigate(['/', RouteNames.DERIVE], {
queryParams: {
Expand All @@ -174,35 +202,8 @@ export class GoogleComponent implements OnInit {
},
queryParamsHandling: 'merge',
});
} else {
if (!this.globalVars.getFreeDeso) {
this.login(signedUp);
}
if (!signedUp) {
this.backendApi
.GetUsersStateless([this.publicKey], true, true)
.subscribe((res) => {
if (res?.UserList?.length) {
if (res.UserList[0].BalanceNanos !== 0) {
this.login(signedUp);
return;
}
}
this.router.navigate(['/', RouteNames.GET_DESO], {
queryParams: { publicKey: this.publicKey, signedUp },
queryParamsHandling: 'merge',
});
});
} else {
this.router.navigate(['/', RouteNames.GET_DESO], {
queryParams: { publicKey: this.publicKey, signedUp },
queryParamsHandling: 'merge',
});
}
return;
}
}

login(signedUp: boolean): void {
this.identityService.login({
users: this.accountService.getEncryptedUsers(),
publicKeyAdded: this.publicKey,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,14 @@ export class BuyDeSoHeroSwapComponent implements OnInit, OnDestroy {
finishFlow(): void {
if (this.globalVars.derive) {
this.router.navigate(['/', RouteNames.DERIVE], {
queryParams: { publicKey: this.publicKey },
queryParams: {
publicKey: this.publicKey,
transactionSpendingLimitResponse:
this.globalVars.transactionSpendingLimitResponse,
deleteKey: this.globalVars.deleteKey || undefined,
derivedPublicKey: this.globalVars.derivedPublicKey || undefined,
expirationDays: this.globalVars.expirationDays || undefined,
},
queryParamsHandling: 'merge',
});
} else {
Expand Down
9 changes: 8 additions & 1 deletion src/app/buy-or-send-deso/buy-or-send-deso.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,14 @@ export class BuyOrSendDesoComponent implements OnInit {
finishFlow(): void {
if (this.globalVars.derive) {
this.router.navigate(['/', RouteNames.DERIVE], {
queryParams: { publicKey: this.publicKeyAdded },
queryParams: {
publicKey: this.publicKeyAdded,
transactionSpendingLimitResponse:
this.globalVars.transactionSpendingLimitResponse,
deleteKey: this.globalVars.deleteKey || undefined,
derivedPublicKey: this.globalVars.derivedPublicKey || undefined,
expirationDays: this.globalVars.expirationDays || undefined,
},
queryParamsHandling: 'merge',
});
} else {
Expand Down
9 changes: 8 additions & 1 deletion src/app/get-deso/get-deso.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,14 @@ export class GetDesoComponent implements OnInit {
}
if (this.globalVars.derive) {
this.router.navigate(['/', RouteNames.DERIVE], {
queryParams: { publicKey: this.publicKeyAdded },
queryParams: {
publicKey: this.publicKeyAdded,
transactionSpendingLimitResponse:
this.globalVars.transactionSpendingLimitResponse,
deleteKey: this.globalVars.deleteKey || undefined,
derivedPublicKey: this.globalVars.derivedPublicKey || undefined,
expirationDays: this.globalVars.expirationDays || undefined,
},
queryParamsHandling: 'merge',
});
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,14 @@ export class SignUpGetStarterDESOComponent implements OnInit {
this.finishFlowEvent.emit();
if (this.globalVars.derive) {
this.router.navigate(['/', RouteNames.DERIVE], {
queryParams: { publicKey: this.publicKey },
queryParams: {
publicKey: this.publicKey,
transactionSpendingLimitResponse:
this.globalVars.transactionSpendingLimitResponse,
deleteKey: this.globalVars.deleteKey || undefined,
derivedPublicKey: this.globalVars.derivedPublicKey || undefined,
expirationDays: this.globalVars.expirationDays || undefined,
},
queryParamsHandling: 'merge',
});
return;
Expand Down