decord/alpha/source/modules/multi_account/MultiAccountManager.tsx
github-actions e160b228c5 chore: update source for alpha 348.1
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4942.js (118.4 MB)
2026-09-22 07:41:18 +00:00

68 lines
2.5 KiB
TypeScript

// Module ID: 17845
// Function ID: 17846
// Name: MultiAccountManager
// Dependencies: [1372, 13902, 7365, 573, 13903, 2]
// Module 17845 (MultiAccountManager)
import DispatcherDefault from "Dispatcher" /* 573 */;
import GatewaySocket from "GatewaySocket" /* 13903 */;
import UserStore from "UserStore" /* 1372 */;
import MultiAccountSwitchStore from "MultiAccountSwitchStore" /* 13902 */;
import AutomaticLifecycleManager from "AutomaticLifecycleManager" /* 7365 */;
require = fn;
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 = MultiAccountSwitchStore.getSwitchResult();
if (null != switchResult) {
const currentUser = UserStore.getCurrentUser();
if (null != currentUser) {
let obj = applyArgumentsResult;
if (switchResult.success) {
switchResult = obj.onSwitchSuccess(currentUser, switchResult.navigateHome);
let obj2 = obj;
} else {
obj.onSwitchError(currentUser);
obj2 = obj;
}
obj = GatewaySocket;
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 = GatewaySocket.setAccountSwitchUserId(targetUserId.targetUserId);
};
const size = fn(2);
let result = size.fileFinishedImporting("modules/multi_account/MultiAccountManager.tsx");
export default MultiAccountManager;