decord/source/modules/multi_account/native/MultiAccountManagerNative.tsx

156 lines
5.3 KiB
TypeScript
Raw Normal View History

2026-09-03 10:05:34 +00:00
// Module ID: 17260
// Function ID: 17261
2026-07-29 08:29:29 +00:00
// Name: push
2026-09-03 10:05:34 +00:00
// Dependencies: [12214, 673, 3, 684, 4724, 17261, 2008, 4333, 1228, 17262, 15, 12217, 1219, 4338, 4332, 4194, 1233, 17263, 2]
2026-07-20 16:05:17 +00:00
2026-09-03 10:05:34 +00:00
// Module 17260 (push)
2026-08-24 06:08:38 +00:00
import set from "set" /* 2 */;
import timestampDefault from "timestamp" /* 3 */;
2026-09-02 09:53:35 +00:00
import setDefault from "set" /* 684 */;
2026-09-01 10:26:29 +00:00
import dispatcherDefault from "dispatcher" /* 4194 */;
2026-09-03 10:05:34 +00:00
import _modDef4724 from "module_4724" /* 4724 */;
import MAX_ACCOUNTS from "MAX_ACCOUNTS" /* 12214 */;
import _initializeDefault from "_initialize" /* 17262 */;
import registerAssetDefault from "registerAsset" /* 17263 */;
2026-09-02 09:53:35 +00:00
import ME from "ME" /* 673 */;
2026-07-23 10:11:24 +00:00
2026-07-29 08:29:29 +00:00
let obj = require;
2026-08-24 06:08:38 +00:00
const SWITCH_ACCOUNTS_MODAL_KEY = MAX_ACCOUNTS.SWITCH_ACCOUNTS_MODAL_KEY;
2026-07-29 08:29:29 +00:00
({ ComponentActions: c4, Routes: c5 } = ME);
2026-08-24 06:08:38 +00:00
let closure_6 = new timestampDefault("MultiAccountManagerNative");
2026-07-29 08:29:29 +00:00
let c7 = "switch-accounts-spinner-modal";
2026-08-24 06:08:38 +00:00
let closure_8 = 15 * setDefault.Millis.SECOND;
2026-07-29 08:29:29 +00:00
let c9 = null;
obj = Object.create(function MultiAccountModalManagerImpl() {
2026-08-24 06:08:38 +00:00
obj = Object.create(new.target.prototype);
2026-07-29 08:29:29 +00:00
obj.cancelled = false;
obj.push = function push() {
2026-08-24 06:08:38 +00:00
obj = closure_1_1(closure_1_2[4]);
obj.pushLazy(obj(closure_1_2[6])(closure_1_2[5], closure_1_2.paths), {}, closure_1_7);
2026-07-29 08:29:29 +00:00
if (obj.cancelled) {
2026-08-24 06:08:38 +00:00
closure_1_1(closure_1_2[4]).popWithKey(closure_1_7);
const tmpResult = closure_1_1(closure_1_2[4]);
2026-07-29 08:29:29 +00:00
}
};
obj.enqueue = function enqueue() {
let arr = obj;
obj.cancelled = false;
2026-08-24 06:08:38 +00:00
obj = obj(closure_1_2[7]);
2026-07-29 08:29:29 +00:00
const rootNavigationRef = obj.getRootNavigationRef();
if (null != rootNavigationRef) {
if (rootNavigationRef.isReady()) {
arr = arr.push();
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
}
2026-08-24 06:08:38 +00:00
const ComponentDispatch = obj(closure_1_2[8]).ComponentDispatch;
ComponentDispatch.subscribeOnce(closure_1_4.NAVIGATOR_READY, () => {
2026-07-29 08:29:29 +00:00
let arr = cancelled;
if (!cancelled.cancelled) {
arr = arr.push();
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
});
};
obj.pop = function pop() {
obj.cancelled = true;
2026-08-24 06:08:38 +00:00
obj = closure_1_1(closure_1_2[4]);
obj.popWithKey(closure_1_7);
2026-07-29 08:29:29 +00:00
};
return obj;
}.prototype.prototype);
obj.cancelled = false;
obj.push = function push() {
2026-08-24 06:08:38 +00:00
obj = closure_1_1(closure_1_2[4]);
obj.pushLazy(obj(closure_1_2[6])(closure_1_2[5], closure_1_2.paths), {}, closure_1_7);
2026-07-29 08:29:29 +00:00
if (obj.cancelled) {
2026-08-24 06:08:38 +00:00
closure_1_1(closure_1_2[4]).popWithKey(closure_1_7);
const tmpResult = closure_1_1(closure_1_2[4]);
2026-07-29 08:29:29 +00:00
}
};
obj.enqueue = function enqueue() {
let arr = obj;
obj.cancelled = false;
2026-08-24 06:08:38 +00:00
obj = obj(closure_1_2[7]);
2026-07-29 08:29:29 +00:00
const rootNavigationRef = obj.getRootNavigationRef();
if (null != rootNavigationRef) {
if (rootNavigationRef.isReady()) {
arr = arr.push();
}
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
const ComponentDispatch = obj(closure_1_2[8]).ComponentDispatch;
ComponentDispatch.subscribeOnce(closure_1_4.NAVIGATOR_READY, () => {
2026-07-29 08:29:29 +00:00
let arr = cancelled;
if (!cancelled.cancelled) {
arr = arr.push();
}
});
};
obj.pop = function pop() {
obj.cancelled = true;
2026-08-24 06:08:38 +00:00
obj = closure_1_1(closure_1_2[4]);
obj.popWithKey(closure_1_7);
2026-07-29 08:29:29 +00:00
};
2026-08-24 06:08:38 +00:00
_initializeDefault;
2026-07-29 08:29:29 +00:00
class MultiAccountManagerNative extends tmp5 {
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const prototype = MultiAccountManagerNative.prototype;
prototype["onSwitchStart"] = function onSwitchStart() {
2026-09-03 10:05:34 +00:00
obj = _modDef4724;
2026-07-29 08:29:29 +00:00
obj.popWithKey(SWITCH_ACCOUNTS_MODAL_KEY);
2026-08-24 06:08:38 +00:00
logger.info("Closing fast-connect socket because of account switch logout");
2026-07-29 08:29:29 +00:00
let result = obj(15).closeFastConnectSocket();
obj.enqueue();
if (null !== timeout) {
const _clearTimeout = clearTimeout;
clearTimeout(timeout);
}
timeout = setTimeout(() => {
arr = arr.pop();
const result = callback(table[11]).reportAccountSwitchTimeout();
}, closure_8);
};
prototype["onSwitchSuccess"] = function onSwitchSuccess(currentUser, navigateHome) {
2026-08-24 06:08:38 +00:00
obj = currentUser;
2026-07-29 08:29:29 +00:00
if (navigateHome) {
2026-09-02 09:53:35 +00:00
obj = obj(1219);
2026-07-29 08:29:29 +00:00
obj.transitionTo(constants.ME, { navigationReplace: true });
2026-09-01 10:26:29 +00:00
const MobileHomeDrawerExperiment = obj(4338).MobileHomeDrawerExperiment;
2026-07-29 08:29:29 +00:00
if (MobileHomeDrawerExperiment.getConfig({ location: "multi-account" }).enableHome) {
2026-09-01 10:26:29 +00:00
tmp(4332).setHomeDrawerState(false);
const tmpResult = tmp(4332);
2026-07-29 08:29:29 +00:00
}
tmp = obj;
}
const timerId = setTimeout(() => {
2026-08-24 06:08:38 +00:00
obj = closure_1_1(closure_1_2[15]);
2026-07-29 08:29:29 +00:00
obj = { key: "SWITCH_ACCOUNTS_TOAST_LOGIN_SUCCESS", content: null, icon: null };
2026-08-24 06:08:38 +00:00
const intl = currentUser(closure_1_2[16]).intl;
2026-07-29 08:29:29 +00:00
obj = { username: currentUser.username };
2026-08-24 06:08:38 +00:00
obj[1] = intl.formatToPlainString(currentUser(closure_1_2[16]).t.wx7O3L, obj);
obj[2] = closure_1_1(closure_1_2[17]);
2026-07-29 08:29:29 +00:00
obj.open(obj);
}, 100);
};
prototype["onSwitchError"] = function onSwitchError(currentUser) {
2026-08-24 06:08:38 +00:00
obj = dispatcherDefault;
2026-07-29 08:29:29 +00:00
obj = { key: "SWITCH_ACCOUNTS_TOAST_LOGIN_ERROR", content: null, icon: null };
2026-09-02 09:53:35 +00:00
const intl = obj(1233).intl;
obj[1] = intl.string(obj(1233).t.pqvKWA);
2026-08-24 06:08:38 +00:00
obj[2] = registerAssetDefault;
2026-07-29 08:29:29 +00:00
obj.open(obj);
};
prototype["onSwitchComplete"] = function onSwitchComplete() {
2026-09-03 10:05:34 +00:00
obj = _modDef4724;
2026-07-29 08:29:29 +00:00
obj.popWithKey(SWITCH_ACCOUNTS_MODAL_KEY);
obj.pop();
if (null !== c9) {
const _clearTimeout = clearTimeout;
clearTimeout(c9);
c9 = null;
}
};
const multiAccountManagerNative = new MultiAccountManagerNative();
2026-08-24 06:08:38 +00:00
const tmp3 = new timestampDefault("MultiAccountManagerNative");
let result = set.fileFinishedImporting("modules/multi_account/native/MultiAccountManagerNative.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default multiAccountManagerNative;