Skip to content

Commit

Permalink
remove Buy DeSo from error modal (#523)
Browse files Browse the repository at this point in the history
  • Loading branch information
lazynina committed Dec 1, 2021
1 parent 030a49f commit 6d6225a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
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

0 comments on commit 6d6225a

Please sign in to comment.