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:
Gorjan Petrovski
2021-09-21 19:01:32 +02:00
committed by GitHub
parent a9610fdbc6
commit 77525a56cd
19 changed files with 342 additions and 70 deletions

View File

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

View File

@@ -161,11 +161,11 @@ export class AppState {
this.onVisibilityChange = undefined;
}
openSessionsModal() {
openSessionsModal(): void {
this.isSessionsModalVisible = true;
}
closeSessionsModal() {
closeSessionsModal(): void {
this.isSessionsModalVisible = false;
}