refactor: move user-related data to appStore
This commit is contained in:
@@ -1,19 +1,16 @@
|
||||
import { AppState } from '@/ui_models/app_state';
|
||||
import { useState } from 'preact/hooks';
|
||||
import { WebApplication } from '@/ui_models/application';
|
||||
import { User } from '@standardnotes/snjs/dist/@types/services/api/responses';
|
||||
import { observer } from 'mobx-react-lite';
|
||||
|
||||
type Props = {
|
||||
application: WebApplication;
|
||||
appState: AppState;
|
||||
user: User | undefined;
|
||||
}
|
||||
|
||||
const Footer = observer(({
|
||||
application,
|
||||
appState,
|
||||
user
|
||||
}: Props) => {
|
||||
const {
|
||||
showLogin,
|
||||
@@ -23,6 +20,8 @@ const Footer = observer(({
|
||||
setSigningOut
|
||||
} = appState.accountMenu;
|
||||
|
||||
const user = application.getUser();
|
||||
|
||||
const { showBetaWarning, disableBetaWarning: disableAppStateBetaWarning } = appState;
|
||||
|
||||
const [appVersion] = useState(() => `v${((window as any).electronAppVersion || application.bridge.appVersion)}`);
|
||||
|
||||
Reference in New Issue
Block a user