mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-09-20 07:35:55 +08:00
Ask for closing Identity popup when empty and not saving #1689
This commit is contained in:
parent
aa52d2e8f8
commit
fa15742edb
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue