decord/source/modules/action_sheet/native/showShareActionSheet.tsx

108 lines
3.6 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 9104
// Function ID: 9105
2026-07-20 16:05:17 +00:00
// Name: showShareActionSheet
2026-08-24 06:08:38 +00:00
// Dependencies: [17, 501, 9105, 9106, 9109, 1208, 2]
2026-07-20 16:05:17 +00:00
// Exports: showShareActionSheet
2026-08-24 06:08:38 +00:00
// Module 9104 (showShareActionSheet)
import set from "set" /* 2 */;
import get_ActivityIndicator from "get ActivityIndicator" /* 17 */;
import enforcingDefault from "enforcing" /* 9105 */;
import trackAppClickInNativeShareSheet from "trackAppClickInNativeShareSheet" /* 9106 */;
import PlatformTypes from "PlatformTypes" /* 501 */;
2026-07-23 10:11:24 +00:00
2026-07-29 08:29:29 +00:00
if (PlatformTypes.isAndroid()) {
2026-08-24 06:08:38 +00:00
const nativeEventEmitter = new get_ActivityIndicator.NativeEventEmitter(enforcingDefault);
2026-07-20 16:05:17 +00:00
nativeEventEmitter.addListener("share-broadcast-receiver-app-clicked", (arg0) => {
({ app, location: _location } = arg0);
2026-08-24 06:08:38 +00:00
const result = trackAppClickInNativeShareSheet.trackAppClickInNativeShareSheet(app, _location);
2026-07-20 16:05:17 +00:00
});
}
2026-08-24 06:08:38 +00:00
let result = set.fileFinishedImporting("modules/action_sheet/native/showShareActionSheet.tsx");
2026-07-20 16:05:17 +00:00
2026-08-14 17:33:39 +00:00
export const showShareActionSheet = function showShareActionSheet(source, PREMIUM_GIFT_SUCCESS_MODAL) {
2026-07-23 10:11:24 +00:00
const _require = source;
2026-08-14 17:33:39 +00:00
let tmp = PREMIUM_GIFT_SUCCESS_MODAL;
2026-08-24 06:08:38 +00:00
importDefault = PREMIUM_GIFT_SUCCESS_MODAL;
2026-07-20 16:05:17 +00:00
if (null != source.source) {
2026-08-04 08:36:32 +00:00
let mediaShareParams = _require(fn[3]).getMediaShareParams(source.source);
const obj2 = _require(fn[3]);
2026-07-20 16:05:17 +00:00
} else {
2026-08-24 06:08:38 +00:00
mediaShareParams = { mediaFallbackUrl: "Array", mediaStagingOptions: "ct" };
2026-07-20 16:05:17 +00:00
}
({ mediaFallbackUrl, mediaStagingOptions } = mediaShareParams);
if (null == source.source) {
mediaFallbackUrl = source.url;
}
2026-08-04 08:36:32 +00:00
if (null != mediaStagingOptions) {
let obj = { onCancel: null };
obj[0] = function onCancel() {
2026-08-14 17:33:39 +00:00
return PREMIUM_GIFT_SUCCESS_MODAL(fn[2]).cancelPendingShare();
2026-08-04 08:36:32 +00:00
};
fn = _require(fn[4]).showSharePreparingModal(obj);
const obj3 = _require(fn[4]);
} else {
fn = () => {
};
}
2026-07-29 08:29:29 +00:00
let message = source.message;
if (message == null) {
message = null;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (mediaFallbackUrl == null) {
mediaFallbackUrl = null;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let subject = source.subject;
if (subject == null) {
subject = null;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (tmp == null) {
tmp = null;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (mediaStagingOptions == null) {
mediaStagingOptions = null;
2026-07-20 16:05:17 +00:00
}
2026-08-04 08:36:32 +00:00
const obj5 = importDefault(fn[2]);
const shareResult = importDefault(fn[2]).share(message, mediaFallbackUrl, subject, tmp, mediaStagingOptions, fn);
const nextPromise = importDefault(fn[2]).share(message, mediaFallbackUrl, subject, tmp, mediaStagingOptions, fn).then((method) => {
if (null != method) {
method = method.method;
if (source.iOSOnlyShareCallback != null) {
let tmp3 = method;
if (method == null) {
tmp3 = null;
}
iOSOnlyShareCallback(tmp, tmp3);
}
const result = source(fn[3]).trackAppClickInNativeShareSheet(method, closure_1);
const obj = source(fn[3]);
}
});
importDefault(fn[2]).share(message, mediaFallbackUrl, subject, tmp, mediaStagingOptions, fn).then((method) => {
2026-07-20 16:05:17 +00:00
if (null != method) {
method = method.method;
2026-07-29 08:29:29 +00:00
if (source.iOSOnlyShareCallback != null) {
let tmp3 = method;
if (method == null) {
tmp3 = null;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
iOSOnlyShareCallback(tmp, tmp3);
2026-07-20 16:05:17 +00:00
}
2026-08-04 08:36:32 +00:00
const result = source(fn[3]).trackAppClickInNativeShareSheet(method, closure_1);
const obj = source(fn[3]);
2026-07-20 16:05:17 +00:00
}
}).catch((arg0) => {
2026-08-14 17:33:39 +00:00
let str = PREMIUM_GIFT_SUCCESS_MODAL;
if (PREMIUM_GIFT_SUCCESS_MODAL == null) {
2026-07-29 08:29:29 +00:00
str = "";
2026-07-20 16:05:17 +00:00
}
2026-08-14 17:33:39 +00:00
PREMIUM_GIFT_SUCCESS_MODAL(fn[5]).captureException(arg0, { tags: { location: str } });
2026-07-29 08:29:29 +00:00
if (source.iOSOnlyShareCallback != null) {
iOSOnlyShareCallback(false, null);
2026-07-20 16:05:17 +00:00
}
2026-08-04 08:36:32 +00:00
}).finally(() => {
fn();
2026-07-20 16:05:17 +00:00
});
};