Skip to content
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

remove Buy DeSo from error modal #523

Merged
merged 1 commit into from
Dec 1, 2021
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
9 changes: 3 additions & 6 deletions src/app/global-vars.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -716,25 +716,22 @@ export class GlobalVarsService {
});
}

_alertError(err: any, showBuyDeSo: boolean = false, showBuyCreatorCoin: boolean = false) {
_alertError(err: any, showBuyCreatorCoin: boolean = false) {
SwalHelper.fire({
target: this.getTargetComponentSelector(),
icon: "error",
title: `Oops...`,
html: err,
showConfirmButton: true,
showCancelButton: showBuyDeSo || showBuyCreatorCoin,
showCancelButton: showBuyCreatorCoin,
focusConfirm: true,
customClass: {
confirmButton: "btn btn-light",
cancelButton: "btn btn-light no",
},
confirmButtonText: showBuyDeSo ? "Buy DeSo" : showBuyCreatorCoin ? "Buy Creator Coin" : "Ok",
confirmButtonText: showBuyCreatorCoin ? "Buy Creator Coin" : "Ok",
reverseButtons: true,
}).then((res) => {
if (showBuyDeSo && res.isConfirmed) {
this.router.navigate([RouteNames.BUY_DESO], { queryParamsHandling: "merge" });
}
if (showBuyCreatorCoin && res.isConfirmed) {
this.router.navigate([RouteNames.CREATORS]);
}
Expand Down
2 changes: 0 additions & 2 deletions src/app/transfer-deso/transfer-deso.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ export class TransferDeSoComponent implements OnInit {
this.sendingDeSo = false;
this.globalVars._alertError(
this.transferDeSoError,
false,
this.transferDeSoError === Messages.MUST_PURCHASE_CREATOR_COIN
);
return;
Expand Down Expand Up @@ -207,7 +206,6 @@ export class TransferDeSoComponent implements OnInit {
this.globalVars.logEvent("bitpop : send : error", { parsedError: this.transferDeSoError });
this.globalVars._alertError(
this.transferDeSoError,
false,
this.transferDeSoError === Messages.MUST_PURCHASE_CREATOR_COIN
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/services/follow/follow.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export class FollowService {
// TODO: there's prob some "out of funds" error which is a problem
const parsedError = this.backendApi.parseMessageError(error);
this.globalVars.logEvent(`user : ${isFollow ? "follow" : "unfollow"} : error`, { parsedError });
this.appData._alertError(parsedError, !!parsedError.indexOf("insufficient"));
this.appData._alertError(parsedError);
}
}
)
Expand Down