Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4973.js (118.4 MB)
252 lines
7.4 KiB
TypeScript
252 lines
7.4 KiB
TypeScript
// Module ID: 14197
|
|
// Function ID: 14198
|
|
// Name: ShareScreenModal
|
|
// Dependencies: [5, 32, 19, 2041, 14150, 21, 3, 4991, 8665, 504, 4801, 1095, 14198, 2]
|
|
// Exports: default
|
|
|
|
// Module 14197 (ShareScreenModal)
|
|
import LoggerDefault from "Logger" /* 3 */;
|
|
import ChannelTypes from "ChannelTypes" /* 1095 */;
|
|
import ModalActionCreatorsDefault from "ModalActionCreators" /* 4991 */;
|
|
import asyncGeneratorStep from "asyncGeneratorStep" /* 5 */;
|
|
import _slicedToArray from "module_32" /* 32 */;
|
|
import noop from "module_19" /* 19 */;
|
|
import ChannelStore from "ChannelStore" /* 2041 */;
|
|
|
|
require = fn;
|
|
function onClose() {
|
|
ModalActionCreatorsDefault.popWithKey(SHARE_SCREEN_MODAL_KEY);
|
|
}
|
|
const SHARE_SCREEN_MODAL_KEY = fn(14150).SHARE_SCREEN_MODAL_KEY;
|
|
const jsx = fn(21).jsx;
|
|
let closure_9 = new LoggerDefault("ShareScreenModal");
|
|
const size = fn(2);
|
|
const result = size.fileFinishedImporting("modules/share/native/ShareScreenModal.tsx");
|
|
|
|
export default function ShareScreenModal(text) {
|
|
text = text.text;
|
|
require = text;
|
|
const channelId = text.channelId;
|
|
const shareId = text.shareId;
|
|
const attachmentManifest = text.attachmentManifest;
|
|
let first;
|
|
noop = undefined;
|
|
let stateFromStores;
|
|
const tmp = first(noop.useState(null), 2);
|
|
first = tmp[0];
|
|
noop = tmp[1];
|
|
let items = [shareId, attachmentManifest];
|
|
const effect = noop.useEffect(() => {
|
|
closure_0 = async function _fetchAttachments(arg0, value) {
|
|
if (v3 === 2) {
|
|
v3 = 3;
|
|
throw new TypeError("Generator functions may not be called on executing generators");
|
|
} else if (tmp6 === 3) {
|
|
if (arg0 === 1) {
|
|
throw value;
|
|
} else if (arg0 === 2) {
|
|
const obj3 = { value, done: true };
|
|
return obj3;
|
|
} else {
|
|
return { value: "HermesInternal", done: null };
|
|
}
|
|
} else {
|
|
try {
|
|
v3 = 2;
|
|
if (0 === c4) {
|
|
if (arg0 === 1) {
|
|
v3 = 3;
|
|
throw value;
|
|
} else if (arg0 === 2) {
|
|
v3 = 3;
|
|
const obj4 = { value, done: true };
|
|
return obj4;
|
|
} else {
|
|
closure_1 = tmp3;
|
|
closure_0 = tmp7;
|
|
closure_128_0 = undefined;
|
|
if (undefined !== closure_2) {
|
|
if (undefined !== c3) {
|
|
c3 = 1;
|
|
c4 = 2;
|
|
v3 = 1;
|
|
const obj5 = { value: channelId(shareId[8]).sharedAttachments(tmp20, tmp21), done: false };
|
|
return obj5;
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
if (1 === tmp7) {
|
|
c3 = 0;
|
|
closure_128_1 = closure_2;
|
|
logger.error("Error fetching attachments:", closure_128_1);
|
|
} else if (arg0 === 1) {
|
|
v3 = 3;
|
|
throw value;
|
|
} else if (arg0 !== 2) {
|
|
closure_128_0 = value;
|
|
v3(closure_128_0);
|
|
c3 = 0;
|
|
}
|
|
c3 = 0;
|
|
v3 = 3;
|
|
const obj = { value, done: true };
|
|
return obj;
|
|
}
|
|
v3 = 3;
|
|
} catch (tmp24) {
|
|
closure_2 = tmp24;
|
|
if (tmp4 === c3) {
|
|
v3 = tmp2;
|
|
throw tmp24;
|
|
} else {
|
|
c4 = tmp;
|
|
}
|
|
}
|
|
}
|
|
};
|
|
!(function fetchAttachments() {
|
|
const self = this;
|
|
const apply = closure_0.apply;
|
|
if (typeof apply === "unknown") {
|
|
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
|
|
} else {
|
|
applyArgumentsResult = apply(self, arguments);
|
|
}
|
|
return applyArgumentsResult;
|
|
})();
|
|
}, items);
|
|
const items1 = [stateFromStores];
|
|
stateFromStores = require("initialize").useStateFromStores(items1, () => ChannelStore.getChannel(channelId));
|
|
const tmp6 = first(noop.useState(null), 2);
|
|
closure_7 = tmp6[1];
|
|
const items2 = [channelId, stateFromStores];
|
|
const effect1 = noop.useEffect(() => {
|
|
closure_0 = async function _fetchChannel(arg0, value) {
|
|
if (c5 === 2) {
|
|
c5 = 3;
|
|
throw new TypeError("Generator functions may not be called on executing generators");
|
|
} else if (tmp6 === 3) {
|
|
if (arg0 === 1) {
|
|
throw value;
|
|
} else if (arg0 === 2) {
|
|
const obj3 = { value, done: true };
|
|
return obj3;
|
|
} else {
|
|
return { value: "HermesInternal", done: null };
|
|
}
|
|
} else {
|
|
try {
|
|
c5 = 2;
|
|
if (0 === c4) {
|
|
if (arg0 === 1) {
|
|
c5 = 3;
|
|
throw value;
|
|
} else if (arg0 === 2) {
|
|
c5 = 3;
|
|
const obj4 = { value, done: true };
|
|
return obj4;
|
|
} else {
|
|
closure_1 = tmp3;
|
|
closure_0 = tmp7;
|
|
closure_128_0 = undefined;
|
|
if (null != closure_1) {
|
|
if (null == stateFromStores) {
|
|
c3 = 1;
|
|
c4 = 2;
|
|
c5 = 1;
|
|
const obj5 = { value: channelId(shareId[10]).fetchChannel(tmp20), done: false };
|
|
return obj5;
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
if (1 === tmp7) {
|
|
c3 = 0;
|
|
closure_128_1 = closure_2;
|
|
logger.error("Error fetching channel:", closure_128_1);
|
|
} else if (arg0 === 1) {
|
|
c5 = 3;
|
|
throw value;
|
|
} else if (arg0 !== 2) {
|
|
closure_128_0 = value;
|
|
closure_1_7(closure_128_0);
|
|
c3 = 0;
|
|
}
|
|
c3 = 0;
|
|
c5 = 3;
|
|
const obj = { value, done: true };
|
|
return obj;
|
|
}
|
|
c5 = 3;
|
|
} catch (tmp24) {
|
|
closure_2 = tmp24;
|
|
if (tmp4 === c3) {
|
|
c5 = tmp2;
|
|
throw tmp24;
|
|
} else {
|
|
c4 = tmp;
|
|
}
|
|
}
|
|
}
|
|
};
|
|
!(function fetchChannel() {
|
|
const self = this;
|
|
const apply = closure_0.apply;
|
|
if (typeof apply === "unknown") {
|
|
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
|
|
} else {
|
|
applyArgumentsResult = apply(self, arguments);
|
|
}
|
|
return applyArgumentsResult;
|
|
})();
|
|
}, items2);
|
|
let first1 = stateFromStores;
|
|
if (stateFromStores == null) {
|
|
first1 = tmp6[0];
|
|
}
|
|
const items3 = [text, first, channelId, first1];
|
|
const memo = noop.useMemo(() => {
|
|
const obj = { text, attachments: null };
|
|
let items = first;
|
|
if (first == null) {
|
|
items = [];
|
|
}
|
|
obj.attachments = items;
|
|
if (null != first1) {
|
|
if (tmp.type !== ChannelTypes.ChannelTypes.DM) {
|
|
obj.targetChannelId = channelId;
|
|
} else {
|
|
let isArray = tmp;
|
|
if (tmp) {
|
|
isArray = "recipients" in tmp;
|
|
}
|
|
if (isArray) {
|
|
const _Array = Array;
|
|
isArray = Array.isArray(tmp.recipients);
|
|
}
|
|
if (isArray) {
|
|
obj.targetUserId = tmp.recipients[0];
|
|
} else {
|
|
let tmp4 = tmp;
|
|
if (tmp) {
|
|
tmp4 = "recipient" in tmp;
|
|
}
|
|
if (tmp4) {
|
|
tmp4 = "id" in tmp.recipient;
|
|
}
|
|
if (tmp4) {
|
|
const recipient = tmp.recipient;
|
|
let id;
|
|
if (recipient != null) {
|
|
id = recipient.id;
|
|
}
|
|
obj.targetUserId = id;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return obj;
|
|
}, items3);
|
|
return first1(channelId(shareId[12]), { sharedContent: memo, onClose });
|
|
};
|