decord/source/modules/multi_account/native/MultiAccountManagerNative.tsx
github-actions f0f877e8ce chore: update source for alpha 347.1
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4824.js (118.4 MB)
2026-09-15 14:23:42 +00:00

147 lines
5.1 KiB
TypeScript

// Module ID: 17579
// Function ID: 17580
// Name: MultiAccountManagerNative
// Dependencies: [12549, 1074, 3, 1091, 4842, 17580, 1897, 4498, 1110, 17581, 15, 12552, 1101, 4503, 4497, 4338, 1115, 17582, 2]
// Module 17579 (MultiAccountManagerNative)
import LoggerDefault from "Logger" /* 3 */;
import DurationsDefault from "Durations" /* 1091 */;
import ToastActionCreatorsDefault from "ToastActionCreators" /* 4338 */;
import ModalActionCreatorsDefault from "ModalActionCreators" /* 4842 */;
import Constants2 from "Constants" /* 12549 */;
import _modDef17582 from "module_17582" /* 17582 */;
import Constants from "Constants" /* 1074 */;
import MultiAccountManager from "MultiAccountManager" /* 17581 */;
import size from "module_2" /* 2 */;
const SWITCH_ACCOUNTS_MODAL_KEY = Constants2.SWITCH_ACCOUNTS_MODAL_KEY;
({ ComponentActions: closure_4, Routes: hasOwnProperty } = Constants);
const logger = new LoggerDefault("MultiAccountManagerNative");
let c7 = "switch-accounts-spinner-modal";
let closure_8 = 15 * DurationsDefault.Millis.SECOND;
let c9 = null;
let obj = Object.create(function MultiAccountModalManagerImpl() {
obj = Object.create(new.target.prototype);
obj.cancelled = false;
obj.push = function push() {
obj = ModalActionCreatorsDefault;
obj.pushLazy(obj(1897)(17580, dependencyMap.paths), {}, c7);
if (obj.cancelled) {
ModalActionCreatorsDefault.popWithKey(c7);
const tmpResult = ModalActionCreatorsDefault;
}
};
obj.enqueue = function enqueue() {
obj.cancelled = false;
obj = obj(4498);
const rootNavigationRef = obj.getRootNavigationRef();
if (null != rootNavigationRef) {
if (rootNavigationRef.isReady()) {
obj.push();
}
}
const ComponentDispatch = obj(1110).ComponentDispatch;
ComponentDispatch.subscribeOnce(constants.NAVIGATOR_READY, () => {
if (!cancelled.cancelled) {
cancelled.push();
}
});
};
obj.pop = function pop() {
obj.cancelled = true;
obj = ModalActionCreatorsDefault;
obj.popWithKey(c7);
};
return obj;
}.prototype.prototype);
obj.cancelled = false;
obj.push = function push() {
obj = ModalActionCreatorsDefault;
obj.pushLazy(obj(1897)(17580, dependencyMap.paths), {}, c7);
if (obj.cancelled) {
ModalActionCreatorsDefault.popWithKey(c7);
const tmpResult = ModalActionCreatorsDefault;
}
};
obj.enqueue = function enqueue() {
obj.cancelled = false;
obj = obj(4498);
const rootNavigationRef = obj.getRootNavigationRef();
if (null != rootNavigationRef) {
if (rootNavigationRef.isReady()) {
obj.push();
}
}
const ComponentDispatch = obj(1110).ComponentDispatch;
ComponentDispatch.subscribeOnce(constants.NAVIGATOR_READY, () => {
if (!cancelled.cancelled) {
cancelled.push();
}
});
};
obj.pop = function pop() {
obj.cancelled = true;
obj = ModalActionCreatorsDefault;
obj.popWithKey(c7);
};
class MultiAccountManagerNative extends tmp5 {
}
const prototype = MultiAccountManagerNative.prototype;
prototype["onSwitchStart"] = function onSwitchStart() {
obj = ModalActionCreatorsDefault;
obj.popWithKey(SWITCH_ACCOUNTS_MODAL_KEY);
logger.info("Closing fast-connect socket because of account switch logout");
let result = obj(15).closeFastConnectSocket();
obj.enqueue();
if (null !== timeout) {
const _clearTimeout = clearTimeout;
clearTimeout(timeout);
}
timeout = setTimeout(() => {
closure_1_10.pop();
const result = closure_1_0(dependencyMap[11]).reportAccountSwitchTimeout();
}, closure_8);
};
prototype["onSwitchSuccess"] = function onSwitchSuccess(currentUser, navigateHome) {
const user = currentUser;
if (navigateHome) {
user(1101).transitionTo(constants2.ME, { navigationReplace: true });
const MobileHomeDrawerExperiment = user(4503).MobileHomeDrawerExperiment;
if (MobileHomeDrawerExperiment.getConfig({ location: "multi-account" }).enableHome) {
tmp(4497).setHomeDrawerState(false);
const tmpResult = tmp(4497);
}
obj = user(1101);
tmp = user;
}
const timerId = setTimeout(() => {
obj = ToastActionCreatorsDefault;
const obj2 = { key: "SWITCH_ACCOUNTS_TOAST_LOGIN_SUCCESS", content: null, icon: null };
const intl = obj(1115).intl;
obj2.content = intl.formatToPlainString(obj(1115).t.wx7O3L, { username: user.username });
obj2.icon = _modDef17582;
obj.open(obj2);
}, 100);
};
prototype["onSwitchError"] = function onSwitchError() {
obj = ToastActionCreatorsDefault;
const obj2 = { key: "SWITCH_ACCOUNTS_TOAST_LOGIN_ERROR", content: null, icon: null };
const intl = obj(1115).intl;
obj2.content = intl.string(obj(1115).t.pqvKWA);
obj2.icon = _modDef17582;
obj.open(obj2);
};
prototype["onSwitchComplete"] = function onSwitchComplete() {
obj = ModalActionCreatorsDefault;
obj.popWithKey(SWITCH_ACCOUNTS_MODAL_KEY);
obj.pop();
if (null !== c9) {
const _clearTimeout = clearTimeout;
clearTimeout(c9);
c9 = null;
}
};
const multiAccountManagerNative = new MultiAccountManagerNative();
let result = size.fileFinishedImporting("modules/multi_account/native/MultiAccountManagerNative.tsx");
export default multiAccountManagerNative;