decord/source/modules/multi_account/MultiAccountManager.tsx
github-actions ecf26fc058 chore: update source for alpha 347.2
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4823.js (118.4 MB)
2026-09-16 07:03:15 +00:00

68 lines
2.5 KiB
TypeScript

// Module ID: 17637
// Function ID: 17638
// Name: MultiAccountManager
// Dependencies: [1372, 13733, 7228, 573, 13734, 2]
// Module 17637 (MultiAccountManager)
import DispatcherDefault from "Dispatcher" /* 573 */;
import GatewaySocket from "GatewaySocket" /* 13734 */;
import UserStore from "UserStore" /* 1372 */;
import MultiAccountSwitchStore from "MultiAccountSwitchStore" /* 13733 */;
import AutomaticLifecycleManager from "AutomaticLifecycleManager" /* 7228 */;
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;