decord/source/modules/media_channel/native/useSetMediaPostThumbnail.tsx

79 lines
2.2 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 10477
// Function ID: 10478
2026-07-20 16:05:17 +00:00
// Name: useSetMediaPostThumbnail
2026-08-24 06:08:38 +00:00
// Dependencies: [19, 4830, 4829, 647, 4834, 8505, 4346, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-24 06:08:38 +00:00
// Module 10477 (useSetMediaPostThumbnail)
import closure_3 from "noop" /* 19 */;
import { DraftType } from "handleChanged" /* 4830 */;
import closure_5 from "map" /* 4829 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("modules/media_channel/native/useSetMediaPostThumbnail.tsx");
2026-07-20 16:05:17 +00:00
export default function useSetMediaPostThumbnail(arg0, arg1) {
2026-07-23 10:11:24 +00:00
const _require = arg0;
2026-08-24 06:08:38 +00:00
closure_1 = arg1;
const items = [closure_5];
2026-07-23 10:11:24 +00:00
stateFromStores = _require(stateFromStores[3]).useStateFromStores(items, () => {
2026-08-24 06:08:38 +00:00
const uploads = closure_1_5.getUploads(closure_0, closure_1_4.ChannelMessage);
2026-07-29 08:29:29 +00:00
let found = uploads.find((item) => {
2026-07-20 16:05:17 +00:00
let platform;
2026-07-29 08:29:29 +00:00
if (item != null) {
2026-07-20 16:05:17 +00:00
item = item.item;
2026-07-29 08:29:29 +00:00
if (item != null) {
2026-07-20 16:05:17 +00:00
platform = item.platform;
}
}
2026-07-29 08:29:29 +00:00
let tmp2 = platform === callback(table[4]).UploadPlatform.REACT_NATIVE;
2026-07-20 16:05:17 +00:00
if (tmp2) {
tmp2 = true === item.isThumbnail;
}
return tmp2;
});
2026-07-29 08:29:29 +00:00
if (found == null) {
found = null;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return found;
2026-07-20 16:05:17 +00:00
});
const items1 = [stateFromStores, arg0, arg1];
2026-07-23 10:11:24 +00:00
return React.useCallback(() => {
2026-07-20 16:05:17 +00:00
let id;
2026-07-29 08:29:29 +00:00
if (callback != null) {
id = tmp.id;
2026-07-20 16:05:17 +00:00
}
if (null != id) {
2026-07-29 08:29:29 +00:00
let tmp4 = null != stateFromStores;
if (tmp4) {
2026-07-20 16:05:17 +00:00
let id1;
2026-07-29 08:29:29 +00:00
if (tmp != null) {
id1 = tmp.id;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp4 = tmp24.id !== id1;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (tmp4) {
let obj = callback(stateFromStores[5]);
2026-08-24 06:08:38 +00:00
obj.update(closure_0, tmp24.id, closure_1_4.ChannelMessage, { thumbnail: false });
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let flag;
if (tmp != null) {
flag = tmp.isThumbnail;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (flag == null) {
flag = false;
}
const obj2 = callback(stateFromStores[5]);
2026-07-20 16:05:17 +00:00
let id2;
2026-07-29 08:29:29 +00:00
if (tmp != null) {
id2 = tmp.id;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj = { thumbnail: null, spoiler: false };
obj[0] = !flag;
2026-08-24 06:08:38 +00:00
obj2.update(closure_0, id2, closure_1_4.ChannelMessage, obj);
2026-07-29 08:29:29 +00:00
callback(stateFromStores[6]).hideActionSheet();
const obj4 = callback(stateFromStores[6]);
2026-07-20 16:05:17 +00:00
}
}, items1);
};