Skip to content

Commit

Permalink
Fix showConfirm cancel was ignored
Browse files Browse the repository at this point in the history
  • Loading branch information
kubk committed Jan 11, 2024
1 parent 39f80e8 commit c7978a4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion dumper/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
### How to run

- Make sure you're in current directory
- Make sure you're in the current directory
- `docker-compose up -d`
- `./dump.sh` or `./restore.sh`
14 changes: 8 additions & 6 deletions src/screens/deck-review/deck-preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,13 @@ export const DeckPreview = observer(() => {
<ButtonSideAligned
icon={"mdi-content-duplicate mdi-24px"}
outline
onClick={() => {
showConfirm(t("duplicate_confirm")).then(() => {
onClick={async () => {
const isConfirmed = await showConfirm(t("duplicate_confirm"));
if (isConfirmed) {
duplicateDeckRequest(deck.id).then(() => {
screenStore.go({ type: "main" });
});
});
}
}}
>
{t("duplicate")}
Expand Down Expand Up @@ -185,10 +186,11 @@ export const DeckPreview = observer(() => {
<ButtonSideAligned
icon={"mdi-delete-circle mdi-24px"}
outline
onClick={() => {
showConfirm(t("delete_deck_confirm")).then(() => {
onClick={async () => {
const isConfirmed = await showConfirm(t("delete_deck_confirm"));
if (isConfirmed) {
deckListStore.removeDeck();
});
}
}}
>
{t("delete")}
Expand Down
7 changes: 4 additions & 3 deletions src/screens/folder-review/folder-preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,11 @@ export const FolderPreview = observer(() => {
<ButtonSideAligned
icon={"mdi-delete-circle mdi-24px"}
outline
onClick={() => {
showConfirm(t("delete_folder_confirm")).then(() => {
onClick={async () => {
const isConfirmed = await showConfirm(t("delete_folder_confirm"));
if (isConfirmed) {
deckListStore.deleteFolder();
});
}
}}
>
{t("delete")}
Expand Down

0 comments on commit c7978a4

Please sign in to comment.