mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-10-06 03:44:56 +08:00
Ask for closing Identity popup when empty and not saving #1689
This commit is contained in:
parent
aa52d2e8f8
commit
fa15742edb
1 changed files with 11 additions and 0 deletions
|
@ -13,6 +13,7 @@ import { folderListOptionsBuilder } from 'Common/Folders';
|
||||||
import { i18n } from 'Common/Translator';
|
import { i18n } from 'Common/Translator';
|
||||||
import { defaultOptionsAfterRender } from 'Common/Utils';
|
import { defaultOptionsAfterRender } from 'Common/Utils';
|
||||||
|
|
||||||
|
import { showScreenPopup } from 'Knoin/Knoin';
|
||||||
import { AskPopupView } from 'View/Popup/Ask';
|
import { AskPopupView } from 'View/Popup/Ask';
|
||||||
|
|
||||||
export class IdentityPopupView extends AbstractViewPopup {
|
export class IdentityPopupView extends AbstractViewPopup {
|
||||||
|
@ -131,4 +132,14 @@ export class IdentityPopupView extends AbstractViewPopup {
|
||||||
afterShow() {
|
afterShow() {
|
||||||
this.identity().id() ? this.labelFocused(true) : this.nameFocused(true);
|
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…
Add table
Reference in a new issue