Prepared code to switch accounts without reload (not working yet)

This commit is contained in:
djmaze 2021-11-11 17:14:06 +01:00
parent d24e0a3e1b
commit 597ea21b70
7 changed files with 67 additions and 31 deletions

View file

@ -16,6 +16,8 @@ import { doc, Settings, leftPanelDisabled } from 'Common/Globals';
import { ThemeStore } from 'Stores/Theme';
//import Remote from 'Remote/User/Fetch';
export class SystemDropDownUserView extends AbstractViewRight {
constructor() {
super('SystemDropDown');
@ -44,11 +46,28 @@ export class SystemDropDownUserView extends AbstractViewRight {
}
accountClick(account, event) {
/* TODO
event.preventDefault();
event.stopPropagation();
Remote.switchAccount(
(iError, oData) => {
if (iError) {
console.dir({
iError: iError,
oData: oData
})
} else {
rl.setData(oData.Result);
// rl.route.reload();
}
},
account.email
);
*/
if (account && 0 === event.button) {
AccountUserStore.loading(true);
setTimeout(() => AccountUserStore.loading(false), 1000);
}
return true;
}