Ask for closing Identity popup when empty and not saving #1689

This commit is contained in:
the-djmaze 2024-08-06 21:28:20 +02:00
parent aa52d2e8f8
commit fa15742edb

View file

@ -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;
}
}
}