mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-04-29 12:53:35 +01:00
Show dialog for permanently undownloadable attachments
This commit is contained in:
38
ts/state/smart/AttachmentNotAvailableModal.tsx
Normal file
38
ts/state/smart/AttachmentNotAvailableModal.tsx
Normal file
@@ -0,0 +1,38 @@
|
||||
// Copyright 2025 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import React, { memo, useCallback } from 'react';
|
||||
import { useSelector } from 'react-redux';
|
||||
import { AttachmentNotAvailableModal } from '../../components/AttachmentNotAvailableModal';
|
||||
import { strictAssert } from '../../util/assert';
|
||||
import { getAttachmentNotAvailableModalType } from '../selectors/globalModals';
|
||||
import { getIntl } from '../selectors/user';
|
||||
import { useGlobalModalActions } from '../ducks/globalModals';
|
||||
|
||||
export const SmartAttachmentNotAvailableModal = memo(
|
||||
function SmartAttachmentNotAvailableModal() {
|
||||
const i18n = useSelector(getIntl);
|
||||
const attachmentNotAvailableModalType = useSelector(
|
||||
getAttachmentNotAvailableModalType
|
||||
);
|
||||
|
||||
strictAssert(
|
||||
attachmentNotAvailableModalType != null,
|
||||
'attachmentNotAvailableModalType is required'
|
||||
);
|
||||
|
||||
const { hideAttachmentNotAvailableModal } = useGlobalModalActions();
|
||||
|
||||
const handleClose = useCallback(() => {
|
||||
hideAttachmentNotAvailableModal();
|
||||
}, [hideAttachmentNotAvailableModal]);
|
||||
|
||||
return (
|
||||
<AttachmentNotAvailableModal
|
||||
i18n={i18n}
|
||||
modalType={attachmentNotAvailableModalType}
|
||||
onClose={handleClose}
|
||||
/>
|
||||
);
|
||||
}
|
||||
);
|
||||
Reference in New Issue
Block a user