Skip to content

Commit

Permalink
feat: show success swal after account disconnection
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronm-2112 committed Aug 20, 2024
1 parent 4f2f218 commit dfdd1c3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/renderer/src/scripts/accounts/accounts.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ while (!window.baseHtmlLoaded) {
}
import * as ini from "ini";
import { addRows, removeRows } from "../../stores/slices/tableRowSlice";
import { swalShowSuccess } from "../utils/swal-utils";

const addAccountOptions = () => {
// set default state
Expand Down Expand Up @@ -82,4 +83,6 @@ window.disconnectPennsieveAccount = async (profileKey) => {
$("#para-continue-bf-dataset-getting-started").text("");
$(".bf-account-span").text("None");
$(".bf-organization-span").text("None");

await swalShowSuccess("Success", "Your Pennsieve account has been disconnected.");
};
15 changes: 15 additions & 0 deletions src/renderer/src/scripts/utils/swal-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,3 +208,18 @@ export const swalConfirmAction = async (icon, title, text, confirmButtonText, ca
});
return action;
};

export const swalShowSuccess = async (title, successText) => {
Swal.close();
await new Promise((resolve) => setTimeout(resolve, 500));
await Swal.fire({
title: title,
html: successText,
icon: "success",
width: 800,
heightAuto: false,
backdrop: "rgba(0,0,0, 0.4)",
showConfirmButton: true,
confirmButtonText: "OK",
});
};

0 comments on commit dfdd1c3

Please sign in to comment.