decord/source/modules/media_keyboard/native/useUploadDisabled.tsx

40 lines
1.4 KiB
TypeScript
Raw Normal View History

// Module ID: 12378
// Function ID: 12379
2026-07-20 16:05:17 +00:00
// Name: useUploadDisabled
// Dependencies: [4979, 4276, 4978, 1074, 504, 7331, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
// Module 12378 (useUploadDisabled)
import DraftStore from "DraftStore" /* 4979 */;
import FakePlaceholderPrivateChannel from "FakePlaceholderPrivateChannel" /* 7331 */;
import PermissionStore from "PermissionStore" /* 4276 */;
import UploadAttachmentStore from "UploadAttachmentStore" /* 4978 */;
import Constants from "Constants" /* 1074 */;
import size from "module_2" /* 2 */;
2026-07-23 10:11:24 +00:00
const require = globalThis.__r;
const DraftType = DraftStore.DraftType;
({ MAX_UPLOAD_COUNT: hasOwnProperty, Permissions: metroRequire } = Constants);
const result = size.fileFinishedImporting("modules/media_keyboard/native/useUploadDisabled.tsx");
2026-07-20 16:05:17 +00:00
export default function useUploadDisabled(arg0) {
_require = arg0;
const items = [PermissionStore, UploadAttachmentStore];
return require("initialize").useStateFromStores(items, () => {
let tmp = UploadAttachmentStore.getUploads(id.id, DraftType.ChannelMessage).length >= hasOwnProperty;
2026-07-20 16:05:17 +00:00
if (!tmp) {
let tmp4 = obj.id === FakePlaceholderPrivateChannel.FAKE_PLACEHOLDER_PRIVATE_CHANNEL_ID;
2026-07-29 08:29:29 +00:00
if (!tmp4) {
let isPrivateResult = obj.isPrivate();
2026-07-20 16:05:17 +00:00
if (!isPrivateResult) {
isPrivateResult = PermissionStore.can(constants.ATTACH_FILES, obj);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp4 = !isPrivateResult;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp = tmp4;
2026-07-20 16:05:17 +00:00
}
return tmp;
});
};