feat: use SNJS userCanManageSessions

This commit is contained in:
Baptiste Grob
2020-12-28 14:44:27 +01:00
parent b84becc9db
commit 7c69cce7b7
2 changed files with 7 additions and 3 deletions

View File

@@ -102,7 +102,7 @@ class AccountMenuCtrl extends PureViewCtrl<{}, AccountMenuState> {
mutable: {},
showBetaWarning: false,
errorReportingEnabled: !storage.get(StorageKey.DisableErrorReporting),
showSessions: this.appState.enableUnfinishedFeatures,
showSessions: false,
} as AccountMenuState;
}
@@ -132,8 +132,12 @@ class AccountMenuCtrl extends PureViewCtrl<{}, AccountMenuState> {
};
}
$onInit() {
async $onInit() {
super.$onInit();
this.setState({
showSessions: await this.application.userCanManageSessions()
});
const sync = this.appState.sync;
this.removeSyncObserver = autorun(() => {
this.setState({

View File

@@ -110,7 +110,7 @@ export class AppState {
showBetaWarning = false;
readonly actionsMenu = new ActionsMenuState();
readonly sync = new SyncState();
isSessionsModalVisible = true;
isSessionsModalVisible = false;
/* @ngInject */
constructor(