decord/source/modules/multi_account/MultiAccountManager.tsx

69 lines
2.4 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 16736
// Function ID: 16737
2026-07-29 08:29:29 +00:00
// Name: _initialize
2026-08-24 06:08:38 +00:00
// Dependencies: [1922, 13326, 5043, 709, 13243, 2]
2026-07-20 16:05:17 +00:00
2026-08-24 06:08:38 +00:00
// Module 16736 (_initialize)
import dispatcherDefault from "dispatcher" /* 709 */;
import initializeDefault from "initialize" /* 5043 */;
import noop from "noop" /* 13243 */;
import closure_3 from "mergeGuildAvatar" /* 1922 */;
import closure_4 from "initialize" /* 13326 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
initializeDefault;
2026-07-29 08:29:29 +00:00
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() {
2026-08-24 06:08:38 +00:00
let switchResult = closure_1_4.getSwitchResult();
2026-07-29 08:29:29 +00:00
if (null != switchResult) {
2026-08-24 06:08:38 +00:00
const currentUser = closure_1_3.getCurrentUser();
2026-07-29 08:29:29 +00:00
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;
}
2026-08-24 06:08:38 +00:00
obj = applyArgumentsResult(closure_1_2[4]);
2026-07-29 08:29:29 +00:00
const result = obj.setAccountSwitchUserId(null);
obj2.onSwitchComplete();
}
}
};
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
const prototype = MultiAccountManager.prototype;
prototype["_initialize"] = function _initialize() {
2026-08-24 06:08:38 +00:00
const subscription = dispatcherDefault.subscribe("CONNECTION_OPEN", this.handleConnectionOpen);
2026-07-29 08:29:29 +00:00
this.handleConnectionOpen();
};
prototype["_terminate"] = function _terminate() {
2026-08-24 06:08:38 +00:00
dispatcherDefault.unsubscribe("CONNECTION_OPEN", this.handleConnectionOpen);
2026-07-29 08:29:29 +00:00
};
prototype["handleLogout"] = function handleLogout(isSwitchingAccount) {
if (isSwitchingAccount.isSwitchingAccount) {
const self = this;
this.onSwitchStart();
}
};
prototype["handleMultiAccountSwitchStart"] = function handleMultiAccountSwitchStart(targetUserId) {
2026-08-24 06:08:38 +00:00
const result = noop.setAccountSwitchUserId(targetUserId.targetUserId);
2026-07-29 08:29:29 +00:00
};
2026-08-24 06:08:38 +00:00
let result = require("set").fileFinishedImporting("modules/multi_account/MultiAccountManager.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default MultiAccountManager;