feat: display warning banner when using the app with no account

This commit is contained in:
Baptiste Grob
2021-02-02 15:40:20 +01:00
parent 94473da61b
commit c084268f51
26 changed files with 709 additions and 197 deletions

View File

@@ -26,6 +26,7 @@
path(d="M480 256l-75.53-33.53L256.1 290.6l-148.77-68.17L32 256l224 102 224-102z")
sessions-modal(
application='self.application'
app-state='self.appState'
)
challenge-modal(
ng-repeat="challenge in self.challenges track by challenge.id"

View File

@@ -62,7 +62,7 @@ class FooterViewCtrl extends PureViewCtrl<unknown, {
public arbitraryStatusMessage?: string
public user?: any
private offline = true
private showAccountMenu = false
public showAccountMenu = false
private didCheckForOffline = false
private queueExtReload = false
private reloadInProgress = false
@@ -75,7 +75,7 @@ class FooterViewCtrl extends PureViewCtrl<unknown, {
private observerRemovers: Array<() => void> = [];
private completedInitialSync = false;
private showingDownloadStatus = false;
private removeBetaWarningListener?: IReactionDisposer;
private autorunDisposer?: IReactionDisposer;
/* @ngInject */
constructor(
@@ -103,7 +103,7 @@ class FooterViewCtrl extends PureViewCtrl<unknown, {
this.rootScopeListener2 = undefined;
(this.closeAccountMenu as any) = undefined;
(this.toggleSyncResolutionMenu as any) = undefined;
this.removeBetaWarningListener?.();
this.autorunDisposer?.();
super.deinit();
}
@@ -115,8 +115,9 @@ class FooterViewCtrl extends PureViewCtrl<unknown, {
});
});
this.loadAccountSwitcherState();
this.removeBetaWarningListener = autorun(() => {
this.autorunDisposer = autorun(() => {
const showBetaWarning = this.appState.showBetaWarning;
this.showAccountMenu = this.appState.accountMenu.show;
this.setState({
showBetaWarning: showBetaWarning,
showDataUpgrade: !showBetaWarning
@@ -255,7 +256,7 @@ class FooterViewCtrl extends PureViewCtrl<unknown, {
if (!this.didCheckForOffline) {
this.didCheckForOffline = true;
if (this.offline && this.application.getNoteCount() === 0) {
this.showAccountMenu = true;
this.appState.accountMenu.setShow(true);
}
}
this.syncUpdated();
@@ -437,7 +438,7 @@ class FooterViewCtrl extends PureViewCtrl<unknown, {
}
accountMenuPressed() {
this.showAccountMenu = !this.showAccountMenu;
this.appState.accountMenu.toggleShow();
this.closeAllRooms();
}
@@ -446,7 +447,7 @@ class FooterViewCtrl extends PureViewCtrl<unknown, {
}
closeAccountMenu() {
this.showAccountMenu = false;
this.appState.accountMenu.setShow(false);
}
lockApp() {
@@ -563,7 +564,7 @@ class FooterViewCtrl extends PureViewCtrl<unknown, {
if (this.application && this.application.authenticationInProgress()) {
return;
}
this.showAccountMenu = false;
this.appState.accountMenu.setShow(false);
}
}

View File

@@ -3,7 +3,7 @@
#notes-title-bar.section-title-bar
.padded
.section-title-bar-header
.title {{self.state.panelTitle}}
.sk-h2.font-semibold.title {{self.state.panelTitle}}
.sk-button.contrast.wide(
ng-click='self.createNewNote()',
title='Create a new note in the selected tag'
@@ -24,6 +24,10 @@
ng-click='self.clearFilterText();',
ng-show='self.state.noteFilter.text'
) ✕
no-account-warning(
application='self.application'
app-state='self.appState'
)
#notes-menu-bar.sn-component
.sk-app-bar.no-edges
.left

View File

@@ -25,9 +25,9 @@
.tag-info
.title(ng-if="!tag.errorDecrypting") {{tag.title}}
.count(ng-show='tag.isAllTag') {{self.state.noteCounts[tag.uuid]}}
.danger.small-text.bold(ng-show='tag.conflictOf') Conflicted Copy
.danger.small-text.bold(ng-show='tag.errorDecrypting && !tag.waitingForKey') Missing Keys
.info.small-text.bold(ng-show='tag.errorDecrypting && tag.waitingForKey') Waiting For Keys
.danger.small-text.font-bold(ng-show='tag.conflictOf') Conflicted Copy
.danger.small-text.font-bold(ng-show='tag.errorDecrypting && !tag.waitingForKey') Missing Keys
.info.small-text.font-bold(ng-show='tag.errorDecrypting && tag.waitingForKey') Waiting For Keys
.tags-title-section.section-title-bar
.section-title-bar-header
.sk-h3.title
@@ -52,9 +52,9 @@
spellcheck='false'
)
.count {{self.state.noteCounts[tag.uuid]}}
.danger.small-text.bold(ng-show='tag.conflictOf') Conflicted Copy
.danger.small-text.bold(ng-show='tag.errorDecrypting && !tag.waitingForKey') Missing Keys
.info.small-text.bold(ng-show='tag.errorDecrypting && tag.waitingForKey') Waiting For Keys
.danger.small-text.font-bold(ng-show='tag.conflictOf') Conflicted Copy
.danger.small-text.font-bold(ng-show='tag.errorDecrypting && !tag.waitingForKey') Missing Keys
.info.small-text.font-bold(ng-show='tag.errorDecrypting && tag.waitingForKey') Waiting For Keys
.menu(ng-show='self.state.selectedTag == tag')
a.item(ng-click='self.selectedRenameTag(tag)' ng-show='!self.state.editingTag') Rename
a.item(ng-click='self.saveTag($event, tag)' ng-show='self.state.editingTag') Save