decord/source/modules/share/native/AppShare.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

127 lines
4.6 KiB
TypeScript

// Module ID: 18134
// Function ID: 18135
// Name: AppShare
// Dependencies: [32, 19, 17, 7570, 14511, 502, 1074, 12557, 21, 504, 6701, 1364, 14550, 12560, 7585, 1241, 5077, 14671, 14006, 1609, 8492, 7149, 17118, 17165, 4988, 2]
// Exports: default
// Module 18134 (AppShare)
import AnalyticsUtilsDefault from "AnalyticsUtils" /* 1241 */;
import PlatformUtils from "PlatformUtils" /* 1364 */;
import useMountEffectDefault from "useMountEffect" /* 5077 */;
import AuthenticationActionCreatorsDefault from "AuthenticationActionCreators" /* 6701 */;
import TTIAnalyticsUtils from "TTIAnalyticsUtils" /* 7585 */;
import AccessibilityManagerDefault from "AccessibilityManager" /* 14550 */;
import _slicedToArray from "module_32" /* 32 */;
import noop from "module_19" /* 19 */;
import AuthenticationStore from "AuthenticationStore" /* 502 */;
const require = globalThis.__r;
require = fn;
get_ActivityIndicator = fn(17);
({ BackHandler: hasOwnProperty, NativeModules: metroRequire } = get_ActivityIndicator);
const AnalyticsTrackingStore = fn(7570);
const ShareStore = fn(14511);
const AnalyticEvents = fn(1074).AnalyticEvents;
let closure_9 = fn(12557).MultiAccountSwitchLocation;
const jsxProd = fn(21);
({ jsx: c10, jsxs: closure_11 } = jsxProd);
const share = "share";
const size = fn(2);
const result = size.fileFinishedImporting("modules/share/native/AppShare.tsx");
export default function AppShare(targetUserId) {
_require = targetUserId;
targetUserId = targetUserId.targetUserId;
closure_129_0 = targetUserId;
closure_129_2 = undefined;
closure_129_3 = undefined;
[first, closure_129_2] = noop.useState(false);
closure_129_1 = first;
let tmp4 = null == targetUserId;
if (!tmp4) {
tmp4 = AuthenticationStore.getId() === targetUserId;
}
const tmpResult = _slicedToArray(noop.useState(tmp4), 2);
closure_129_3 = tmpResult[1];
const items = [first];
const effect = obj.useEffect(() => {
if (!closure_1_1) {
AccessibilityManagerDefault.init();
dependencyMap(true);
}
}, items);
const items1 = [targetUserId];
const effect1 = obj.useEffect(() => {
let tmp2 = null != closure_0;
if (tmp2) {
tmp2 = AuthenticationStore.getId() !== tmp;
}
if (tmp2) {
const _setTimeout = setTimeout;
const timerId = setTimeout(() => {
const obj = closure_0(12560);
closure_0(12560).switchAccount(targetUserId, false, constants.SHARE_EXTENSION).then(() => {
closure_1_3(true);
});
}, 18);
}
}, items1);
if (first) {
first = tmpResult[0];
}
const items2 = [AuthenticationStore];
const stateFromStores = require("initialize").useStateFromStores(items2, () => authenticated.isAuthenticated());
closure_130_0 = stateFromStores;
const items3 = [stateFromStores];
const effect2 = obj.useEffect(() => {
if (closure_0) {
AuthenticationActionCreatorsDefault.startSession(AuthenticationStore.getToken());
if (obj2.isAndroid()) {
const NativePermissionManager = timestampProducer.NativePermissionManager;
const notificationAuthorization = NativePermissionManager.requestNotificationAuthorization();
}
obj2 = PlatformUtils;
}
}, items3);
const items4 = [targetUserId.attachments.length, targetUserId.text];
const effect3 = obj.useEffect(() => {
let tmp2 = null != targetUserId.text;
if (tmp2) {
tmp2 = tmp.text.length > 0;
}
AnalyticsUtilsDefault.track(AnalyticEvents.EXTERNAL_SHARE_OPENED, { has_content: tmp2, has_attachment: targetUserId.attachments.length > 0 });
}, items4);
useMountEffectDefault(() => {
const attachments = targetUserId.attachments;
const mapped = attachments.map((mimeType) => {
let str = mimeType.mimeType;
if (str == null) {
str = "unknown";
}
return str;
});
TTIAnalyticsUtils.trackAppUIViewed("share", { share_num_attachments: targetUserId.attachments.length, share_attachment_mimetypes: mapped });
});
const obj3 = { appEntryKey: share, children: null };
if (first) {
const obj4 = { appEntryKey: tmp18, sharedContent: targetUserId, onClose: null };
const tmp14Result = tmp14(14006);
if (tmp9Result.isMetaQuest()) {
exitApp = tmp14(8492).close;
} else {
exitApp = exitApp.exitApp;
}
obj4.onClose = exitApp;
tmp19(tmp14Result, obj4);
tmp9Result = tmp9(1609);
} else {
const items5 = [tmp19(tmp9(7149).SceneLoadingIndicator, {}), , , ];
const obj5 = { appEntryKey: tmp18 };
items5[1] = tmp19(tmp9(17118).ActionSheetContainer, obj5);
items5[2] = tmp19(tmp14(17165), {});
items5[3] = tmp19(tmp9(4988).AlertModalContainer, {});
obj3.children = items5;
return closure_11(tmp17, obj3);
}
};