refactor: migrate account-menu to react - implement functionality
- remove all Angular code related to `account-menu` - rename React component to AccountMenu so that many parts of old code remain unchanged - code cleanup
This commit is contained in:
@@ -15,7 +15,7 @@ class EditorGroupViewCtrl extends PureViewCtrl<unknown, {
|
||||
super($timeout);
|
||||
this.state = {
|
||||
showMultipleSelectedNotes: false
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
$onInit() {
|
||||
|
||||
@@ -13,12 +13,6 @@
|
||||
.sk-app-bar-item-column
|
||||
.sk-label.title(ng-class='{red: ctrl.hasError}') Account
|
||||
account-menu(
|
||||
close-function='ctrl.closeAccountMenu()',
|
||||
ng-click='$event.stopPropagation()',
|
||||
ng-if='ctrl.showAccountMenu',
|
||||
application='ctrl.application'
|
||||
)
|
||||
account-menu-react(
|
||||
ng-click='$event.stopPropagation()',
|
||||
app-state='ctrl.appState'
|
||||
application='ctrl.application'
|
||||
|
||||
@@ -62,7 +62,6 @@ class FooterViewCtrl extends PureViewCtrl<unknown, {
|
||||
public user?: any
|
||||
private offline = true
|
||||
public showAccountMenu = false
|
||||
public showAccountMenuReact = false
|
||||
private didCheckForOffline = false
|
||||
private queueExtReload = false
|
||||
private reloadInProgress = false
|
||||
@@ -116,7 +115,6 @@ class FooterViewCtrl extends PureViewCtrl<unknown, {
|
||||
this.autorun(() => {
|
||||
const showBetaWarning = this.appState.showBetaWarning;
|
||||
this.showAccountMenu = this.appState.accountMenu.show;
|
||||
this.showAccountMenuReact = this.appState.accountMenuReact.show;
|
||||
this.setState({
|
||||
showBetaWarning: showBetaWarning,
|
||||
showDataUpgrade: !showBetaWarning
|
||||
@@ -256,7 +254,6 @@ class FooterViewCtrl extends PureViewCtrl<unknown, {
|
||||
this.didCheckForOffline = true;
|
||||
if (this.offline && this.application.getNoteCount() === 0) {
|
||||
this.appState.accountMenu.setShow(true);
|
||||
this.appState.accountMenuReact.setShow(true);
|
||||
}
|
||||
}
|
||||
this.syncUpdated();
|
||||
@@ -439,7 +436,6 @@ class FooterViewCtrl extends PureViewCtrl<unknown, {
|
||||
|
||||
accountMenuPressed() {
|
||||
this.appState.accountMenu.toggleShow();
|
||||
this.appState.accountMenuReact.toggleShow();
|
||||
this.closeAllRooms();
|
||||
}
|
||||
|
||||
@@ -449,7 +445,6 @@ class FooterViewCtrl extends PureViewCtrl<unknown, {
|
||||
|
||||
closeAccountMenu() {
|
||||
this.appState.accountMenu.setShow(false);
|
||||
this.appState.accountMenuReact.setShow(false);
|
||||
}
|
||||
|
||||
lockApp() {
|
||||
@@ -567,7 +562,6 @@ class FooterViewCtrl extends PureViewCtrl<unknown, {
|
||||
return;
|
||||
}
|
||||
this.appState.accountMenu.setShow(false);
|
||||
this.appState.accountMenuReact.setShow(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user