decord/source/modules/share/native/ShareScreenModal.tsx
2026-07-25 08:10:48 +00:00

103 lines
3.2 KiB
TypeScript

// Module ID: 12969
// Function ID: 100587
// Name: onClose
// Dependencies: [5, 57, 31, 1348, 12921, 33, 3, 4338, 8135, 566, 4141, 669, 12970, 2]
// Exports: default
// Module 12969 (onClose)
import jsxProd from "jsxProd";
import _slicedToArray from "_slicedToArray";
import result from "result";
import _isNativeReflectConstruct from "_isNativeReflectConstruct";
import { SHARE_SCREEN_MODAL_KEY } from "SHARE_SCREEN_MODAL_KEY";
import { jsx } from "jsxProd";
import importDefaultResult from "_isNativeReflectConstruct";
let require = arg1;
function onClose() {
importDefault(4338).popWithKey(SHARE_SCREEN_MODAL_KEY);
}
importDefaultResult = new importDefaultResult("ShareScreenModal");
const result = require("result").fileFinishedImporting("modules/share/native/ShareScreenModal.tsx");
export default function ShareScreenModal(text) {
let SHARE_SCREEN_MODAL_KEY;
let tmp6;
text = text.text;
const require = text;
const channelId = text.channelId;
const shareId = text.shareId;
const attachmentManifest = text.attachmentManifest;
let jsx;
const tmp = first(React.useState(null), 2);
first = tmp[0];
React = tmp[1];
const items = [shareId, attachmentManifest];
const effect = React.useEffect(() => {
function _fetchAttachments() {
// CreateGeneratorClosureLongIndex (0x67)
const obj = attachmentManifest(tmp);
return obj(...arguments);
}
!(function fetchAttachments() {
return _fetchAttachments(...arguments);
})();
}, items);
let obj = require(shareId[9]);
const items1 = [stateFromStores];
stateFromStores = obj.useStateFromStores(items1, () => stateFromStores.getChannel(channelId));
[tmp6, SHARE_SCREEN_MODAL_KEY] = first(React.useState(null), 2);
const items2 = [channelId, stateFromStores];
const effect1 = React.useEffect(() => {
function _fetchChannel() {
// CreateGeneratorClosureLongIndex (0x67)
const obj = attachmentManifest(tmp);
return obj(...arguments);
}
!(function fetchChannel() {
return _fetchChannel(...arguments);
})();
}, items2);
jsx = tmp6;
const items3 = [text, first, channelId, tmp6];
const memo = React.useMemo(() => {
const obj = { text: closure_0, attachments: null != first ? first : [] };
if (null == _undefined) {
return obj;
} else if (_undefined.type !== text(shareId[11]).ChannelTypes.DM) {
obj.targetChannelId = channelId;
return obj;
} else {
let isArray = _undefined;
if (_undefined) {
isArray = "recipients" in tmp11;
}
if (isArray) {
const _Array = Array;
isArray = Array.isArray(tmp11.recipients);
}
if (isArray) {
obj.targetUserId = tmp3.recipients[0];
} else {
let tmp4 = tmp3;
if (tmp3) {
tmp4 = "recipient" in tmp3;
}
if (tmp4) {
tmp4 = "id" in tmp3.recipient;
}
if (tmp4) {
const recipient = _undefined.recipient;
let id;
if (null != recipient) {
id = recipient.id;
}
obj.targetUserId = id;
}
}
return obj;
}
}, items3);
obj = { sharedContent: memo, onClose };
return jsx(channelId(shareId[12]), { sharedContent: memo, onClose });
};