feat: implement UI for logging out (#638)
* feat: implement UI for logging out * feat: use old style dialogs for logout confirmation * feat: implement manage sessions * feat: implement session logout success dialog * feat: use snjs alert for revoking sessions confirmation * fix: make OtherSessionsLogout easier to read
This commit is contained in:
@@ -6,6 +6,7 @@ import { SNItem } from '@standardnotes/snjs/dist/@types/models/core/item';
|
||||
export class AccountMenuState {
|
||||
show = false;
|
||||
signingOut = false;
|
||||
otherSessionsLogOut = false;
|
||||
server: string | undefined = undefined;
|
||||
notesAndTags: SNItem[] = [];
|
||||
isEncryptionEnabled = false;
|
||||
@@ -21,6 +22,7 @@ export class AccountMenuState {
|
||||
makeObservable(this, {
|
||||
show: observable,
|
||||
signingOut: observable,
|
||||
otherSessionsLogOut: observable,
|
||||
server: observable,
|
||||
notesAndTags: observable,
|
||||
isEncryptionEnabled: observable,
|
||||
@@ -35,6 +37,7 @@ export class AccountMenuState {
|
||||
setIsEncryptionEnabled: action,
|
||||
setEncryptionStatusString: action,
|
||||
setIsBackupEncrypted: action,
|
||||
setOtherSessionsLogout: action,
|
||||
|
||||
notesAndTagsCount: computed
|
||||
});
|
||||
@@ -106,6 +109,10 @@ export class AccountMenuState {
|
||||
this.show = !this.show;
|
||||
};
|
||||
|
||||
setOtherSessionsLogout = (otherSessionsLogOut: boolean): void => {
|
||||
this.otherSessionsLogOut = otherSessionsLogOut;
|
||||
}
|
||||
|
||||
get notesAndTagsCount(): number {
|
||||
return this.notesAndTags.length;
|
||||
}
|
||||
|
||||
@@ -161,11 +161,11 @@ export class AppState {
|
||||
this.onVisibilityChange = undefined;
|
||||
}
|
||||
|
||||
openSessionsModal() {
|
||||
openSessionsModal(): void {
|
||||
this.isSessionsModalVisible = true;
|
||||
}
|
||||
|
||||
closeSessionsModal() {
|
||||
closeSessionsModal(): void {
|
||||
this.isSessionsModalVisible = false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user