diff --git a/dev/View/Popup/Identity.js b/dev/View/Popup/Identity.js index 07c643e1b8..58459f3a82 100644 --- a/dev/View/Popup/Identity.js +++ b/dev/View/Popup/Identity.js @@ -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 { @@ -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; + } + } }