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:
VardanHakobyan
2021-06-07 20:30:49 +04:00
parent 6db97436b8
commit 7f11e25e63
14 changed files with 430 additions and 1427 deletions

View File

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