decord/beta/source/modules/share/native/resolveShareSendOutcome.tsx
github-actions 30c0bb2ec3 chore: update source for beta 347.10
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4975.js (118.4 MB)
2026-09-24 16:03:38 +00:00

73 lines
2.4 KiB
TypeScript

// Module ID: 14210
// Function ID: 14211
// Name: resolveShareSendOutcome
// Dependencies: [11315, 2]
// Exports: getShareUploadError, pairDestinationsWithChannels, resolveShareSendOutcome, withoutSentDestinations
// Module 14210 (resolveShareSendOutcome)
import formatResults from "formatResults" /* 11315 */;
import size from "module_2" /* 2 */;
const result = size.fileFinishedImporting("modules/share/native/resolveShareSendOutcome.tsx");
export const getShareUploadError = function getShareUploadError(uploadError) {
uploadError = undefined;
if (uploadError != null) {
uploadError = uploadError.uploadError;
}
if (uploadError == null) {
uploadError = null;
}
return uploadError;
};
export const pairDestinationsWithChannels = function pairDestinationsWithChannels(arr, arg1) {
closure_0 = arg1;
const items = [];
const item = arr.forEach((destination, index) => {
if (null != closure_0[index]) {
const obj = { destination, channelId: tmp };
items.push(obj);
}
});
return items;
};
export const withoutSentDestinations = function withoutSentDestinations(arr, arr2) {
if (0 === arr2.length) {
const items = [];
HermesBuiltin.arraySpread(arr, 0);
return items;
} else {
const _Set = Set;
set = new Set(arr2.map(set(11315).destinationKey));
return arr.filter((item) => !set.has(formatResults.destinationKey(item)));
}
};
export const resolveShareSendOutcome = function resolveShareSendOutcome(arr) {
const found = arr.filter((status) => "sent" === status.status);
const found1 = arr.filter((status) => "failed" === status.status);
let tmp = null;
if (0 === found.length) {
const mapped = found1.map((uploadError) => uploadError.uploadError);
let found2 = mapped.find((item) => null != item);
if (found2 == null) {
found2 = null;
}
tmp = found2;
}
const obj = { sentDestinations: found.map((destination) => destination.destination), failedDestinations: found1.map((destination) => destination.destination), transitionChannelId: null, uploadErrorToAlert: null };
let tmp3 = null;
if (0 === found1.length) {
const first = found[0];
let channelId;
if (first != null) {
channelId = first.channelId;
}
if (channelId == null) {
channelId = null;
}
tmp3 = channelId;
}
obj.transitionChannelId = tmp3;
obj.uploadErrorToAlert = tmp;
return obj;
};