Skip to content

Commit

Permalink
Ask for closing Identity popup when empty and not saving #1689
Browse files Browse the repository at this point in the history
  • Loading branch information
the-djmaze committed Aug 6, 2024
1 parent aa52d2e commit fa15742
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions dev/View/Popup/Identity.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { folderListOptionsBuilder } from 'Common/Folders';
import { i18n } from 'Common/Translator';
import { defaultOptionsAfterRender } from 'Common/Utils';

import { showScreenPopup } from 'Knoin/Knoin';
import { AskPopupView } from 'View/Popup/Ask';

export class IdentityPopupView extends AbstractViewPopup {
Expand Down Expand Up @@ -131,4 +132,14 @@ export class IdentityPopupView extends AbstractViewPopup {
afterShow() {
this.identity().id() ? this.labelFocused(true) : this.nameFocused(true);
}

onClose() {
if (!this.identity().exists()) {
showScreenPopup(AskPopupView, [
i18n('POPUPS_ASK/DESC_WANT_CLOSE_THIS_WINDOW'),
() => this.close()
]);
return false;
}
}
}

0 comments on commit fa15742

Please sign in to comment.