Skip to content

Commit

Permalink
feat: use SNJS userCanManageSessions
Browse files Browse the repository at this point in the history
  • Loading branch information
arielsvg committed Dec 28, 2020
1 parent b84becc commit 7c69cce
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions app/assets/javascripts/directives/views/accountMenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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({
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/ui_models/app_state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export class AppState {
showBetaWarning = false;
readonly actionsMenu = new ActionsMenuState();
readonly sync = new SyncState();
isSessionsModalVisible = true;
isSessionsModalVisible = false;

/* @ngInject */
constructor(
Expand Down

0 comments on commit 7c69cce

Please sign in to comment.