decord/source/modules/share/native/AppShare.tsx

129 lines
4.3 KiB
TypeScript
Raw Normal View History

2026-08-25 06:04:03 +00:00
// Module ID: 17269
// Function ID: 17270
2026-07-20 16:05:17 +00:00
// Name: AppShare
2026-08-25 06:04:03 +00:00
// Dependencies: [32, 19, 17, 7068, 13864, 1218, 676, 11978, 21, 589, 5933, 500, 13903, 11981, 7081, 698, 4831, 14022, 13453, 1625, 9071, 5928, 16254, 16301, 4750, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-25 06:04:03 +00:00
// Module 17269 (AppShare)
2026-08-24 06:08:38 +00:00
import closure_3 from "_slicedToArray" /* 32 */;
import closure_4 from "noop" /* 19 */;
import get_ActivityIndicator from "get ActivityIndicator" /* 17 */;
2026-08-25 06:04:03 +00:00
import result from "result" /* 7068 */;
import handleTokenUpdated from "handleTokenUpdated" /* 13864 */;
2026-08-24 06:08:38 +00:00
import closure_7 from "fetchFingerprint" /* 1218 */;
import { AnalyticEvents } from "ME" /* 676 */;
2026-08-25 06:04:03 +00:00
import { MultiAccountSwitchLocation as closure_9 } from "MAX_ACCOUNTS" /* 11978 */;
2026-08-24 06:08:38 +00:00
import jsxProd from "jsxProd" /* 21 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-29 08:29:29 +00:00
({ BackHandler: c5, NativeModules: closure_6 } = get_ActivityIndicator);
({ jsx: c10, jsxs: unpackModuleId } = jsxProd);
const share = "share";
2026-08-24 06:08:38 +00:00
result = require("set").fileFinishedImporting("modules/share/native/AppShare.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default function AppShare(targetUserId) {
let stateFromStores = targetUserId;
targetUserId = targetUserId.targetUserId;
stateFromStores = targetUserId;
let first;
2026-08-24 06:08:38 +00:00
dependencyMap = undefined;
2026-07-29 08:29:29 +00:00
let callback;
let obj = React;
let tmp2 = callback(React.useState(false), 2);
first = tmp2[0];
dependencyMap = tmp2[1];
let tmp4 = null == targetUserId;
if (!tmp4) {
tmp4 = id.getId() === targetUserId;
}
const tmpResult = callback(React.useState(tmp4), 2);
callback = tmpResult[1];
const items = [first];
const effect = obj.useEffect(() => {
if (!first) {
2026-08-25 06:04:03 +00:00
first(13903).init();
2026-07-29 08:29:29 +00:00
dependencyMap(true);
2026-08-25 06:04:03 +00:00
const obj = first(13903);
2026-07-29 08:29:29 +00:00
}
}, items);
const items1 = [targetUserId];
const effect1 = obj.useEffect(() => {
let tmp2 = null != stateFromStores;
if (tmp2) {
2026-08-24 06:08:38 +00:00
tmp2 = closure_1_7.getId() !== tmp;
2026-07-29 08:29:29 +00:00
}
if (tmp2) {
const _setTimeout = setTimeout;
const timerId = setTimeout(() => {
2026-08-24 06:08:38 +00:00
const obj = closure_1_0(closure_1_2[13]);
closure_1_0(closure_1_2[13]).switchAccount(closure_0, false, closure_1_9.SHARE_EXTENSION).then(() => {
2026-07-29 08:29:29 +00:00
callback(true);
});
}, 18);
}
}, items1);
if (first) {
first = tmpResult[0];
}
2026-08-24 06:08:38 +00:00
obj1 = stateFromStores(589);
2026-07-29 08:29:29 +00:00
const items2 = [id];
stateFromStores = obj1.useStateFromStores(items2, () => authenticated.isAuthenticated());
const items3 = [stateFromStores];
const effect2 = obj.useEffect(() => {
if (stateFromStores) {
2026-08-25 06:04:03 +00:00
first(5933).startSession(closure_1_7.getToken());
const obj = first(5933);
2026-07-29 08:29:29 +00:00
if (obj2.isAndroid()) {
2026-08-24 06:08:38 +00:00
const NativePermissionManager = closure_1_6.NativePermissionManager;
2026-07-29 08:29:29 +00:00
const notificationAuthorization = NativePermissionManager.requestNotificationAuthorization();
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj2 = stateFromStores(500);
}
}, items3);
const items4 = [targetUserId.attachments.length, targetUserId.text];
const effect3 = obj.useEffect(() => {
let obj = first(698);
let tmp2 = null != stateFromStores.text;
if (tmp2) {
tmp2 = tmp.text.length > 0;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj = { has_content: tmp2, has_attachment: tmp.attachments.length > 0 };
2026-08-24 06:08:38 +00:00
obj.track(closure_1_8.EXTERNAL_SHARE_OPENED, obj);
2026-07-29 08:29:29 +00:00
}, items4);
2026-08-25 06:04:03 +00:00
first(4831)(() => {
2026-07-29 08:29:29 +00:00
const attachments = stateFromStores.attachments;
const mapped = attachments.map((mimeType) => {
let str = mimeType.mimeType;
if (str == null) {
str = "unknown";
}
return str;
2026-07-20 16:05:17 +00:00
});
2026-08-25 06:04:03 +00:00
stateFromStores(7081).trackAppUIViewed("share", { share_num_attachments: stateFromStores.attachments.length, share_attachment_mimetypes: mapped });
2026-07-20 16:05:17 +00:00
});
2026-07-29 08:29:29 +00:00
obj = { appEntryKey: share, children: null };
if (first) {
obj = { appEntryKey: null, sharedContent: null, onClose: null };
obj[0] = tmp18;
obj[1] = targetUserId;
2026-08-25 06:04:03 +00:00
const tmp14Result = tmp14(13453);
2026-07-29 08:29:29 +00:00
if (tmp9Result.isMetaQuest()) {
2026-08-25 06:04:03 +00:00
let exitApp = tmp14(9071).close;
2026-07-20 16:05:17 +00:00
} else {
exitApp = exitApp.exitApp;
}
2026-07-29 08:29:29 +00:00
obj[2] = exitApp;
tmp19(tmp14Result, obj);
2026-08-15 05:55:55 +00:00
tmp9Result = tmp9(1625);
2026-07-20 16:05:17 +00:00
} else {
2026-08-25 06:04:03 +00:00
const items5 = [tmp19(tmp9(5928).SceneLoadingIndicator, {}), , , ];
2026-07-29 08:29:29 +00:00
obj1 = { appEntryKey: null };
obj1[0] = tmp18;
2026-08-25 06:04:03 +00:00
items5[1] = tmp19(tmp9(16254).ActionSheetContainer, obj1);
items5[2] = tmp19(tmp14(16301), {});
items5[3] = tmp19(tmp9(4750).AlertModalContainer, {});
2026-07-29 08:29:29 +00:00
obj[1] = items5;
return closure_11(tmp17, obj);
2026-07-20 16:05:17 +00:00
}
};