mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-30 20:49:20 +03:00
Prepared code to switch accounts without reload (not working yet)
This commit is contained in:
parent
d24e0a3e1b
commit
597ea21b70
7 changed files with 67 additions and 31 deletions
|
|
@ -56,6 +56,13 @@ class RemoteUserFetch extends AbstractFetchRemote {
|
|||
this.defaultRequest(fCallback, 'Login', oData);
|
||||
}
|
||||
|
||||
/*
|
||||
// TODO SystemDropDownUserView.accountClick
|
||||
switchAccount(fCallback, email) {
|
||||
this.defaultRequest(fCallback, 'AccountSwitch', {Email:email});
|
||||
}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @param {?Function} fCallback
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue