68 lines
2.4 KiB
TypeScript
68 lines
2.4 KiB
TypeScript
// Module ID: 16768
|
|
// Function ID: 16769
|
|
// Name: _initialize
|
|
// Dependencies: [1922, 13188, 5367, 709, 13105, 2]
|
|
|
|
// Module 16768 (_initialize)
|
|
import dispatcherDefault from "dispatcher" /* 709 */;
|
|
import initializeDefault from "initialize" /* 5367 */;
|
|
import noop from "noop" /* 13105 */;
|
|
import closure_3 from "mergeGuildAvatar" /* 1922 */;
|
|
import closure_4 from "initialize" /* 13188 */;
|
|
|
|
require = arg1;
|
|
initializeDefault;
|
|
class MultiAccountManager extends tmp2 {
|
|
constructor() {
|
|
applyArgumentsResult = HermesBuiltin.applyArguments(new.target, new.target);
|
|
closure_0 = applyArgumentsResult;
|
|
applyArgumentsResult.actions = {
|
|
LOGOUT(arg0) {
|
|
return applyArgumentsResult.handleLogout(arg0);
|
|
},
|
|
MULTI_ACCOUNT_SWITCH_START(targetUserId) {
|
|
return applyArgumentsResult.handleMultiAccountSwitchStart(targetUserId);
|
|
}
|
|
};
|
|
applyArgumentsResult.handleConnectionOpen = function handleConnectionOpen() {
|
|
let switchResult = closure_1_4.getSwitchResult();
|
|
if (null != switchResult) {
|
|
const currentUser = closure_1_3.getCurrentUser();
|
|
if (null != currentUser) {
|
|
let obj = closure_0;
|
|
if (switchResult.success) {
|
|
switchResult = obj.onSwitchSuccess(currentUser, switchResult.navigateHome);
|
|
let obj2 = obj;
|
|
} else {
|
|
obj.onSwitchError(currentUser);
|
|
obj2 = obj;
|
|
}
|
|
obj = applyArgumentsResult(closure_1_2[4]);
|
|
const result = obj.setAccountSwitchUserId(null);
|
|
obj2.onSwitchComplete();
|
|
}
|
|
}
|
|
};
|
|
return applyArgumentsResult;
|
|
}
|
|
}
|
|
const prototype = MultiAccountManager.prototype;
|
|
prototype["_initialize"] = function _initialize() {
|
|
const subscription = dispatcherDefault.subscribe("CONNECTION_OPEN", this.handleConnectionOpen);
|
|
this.handleConnectionOpen();
|
|
};
|
|
prototype["_terminate"] = function _terminate() {
|
|
dispatcherDefault.unsubscribe("CONNECTION_OPEN", this.handleConnectionOpen);
|
|
};
|
|
prototype["handleLogout"] = function handleLogout(isSwitchingAccount) {
|
|
if (isSwitchingAccount.isSwitchingAccount) {
|
|
const self = this;
|
|
this.onSwitchStart();
|
|
}
|
|
};
|
|
prototype["handleMultiAccountSwitchStart"] = function handleMultiAccountSwitchStart(targetUserId) {
|
|
const result = noop.setAccountSwitchUserId(targetUserId.targetUserId);
|
|
};
|
|
let result = require("set").fileFinishedImporting("modules/multi_account/MultiAccountManager.tsx");
|
|
|
|
export default MultiAccountManager;
|