diff --git a/app/assets/javascripts/Components/AttachedFilesPopover/AttachedFilesButton.tsx b/app/assets/javascripts/Components/AttachedFilesPopover/AttachedFilesButton.tsx index 587736362..9814f8d59 100644 --- a/app/assets/javascripts/Components/AttachedFilesPopover/AttachedFilesButton.tsx +++ b/app/assets/javascripts/Components/AttachedFilesPopover/AttachedFilesButton.tsx @@ -84,11 +84,6 @@ export const AttachedFilesButton: FunctionComponent = observer( }, [application, note]) const toggleAttachedFilesMenu = useCallback(async () => { - if (!appState.features.hasFiles) { - premiumModal.activate('Files') - return - } - const rect = buttonRef.current?.getBoundingClientRect() if (rect) { const { clientHeight } = document.documentElement @@ -111,7 +106,20 @@ export const AttachedFilesButton: FunctionComponent = observer( setOpen(newOpenState) } - }, [appState.features.hasFiles, onClickPreprocessing, open, premiumModal]) + }, [onClickPreprocessing, open]) + + const prospectivelyShowFilesPremiumModal = useCallback(() => { + if (!appState.features.hasFiles) { + premiumModal.activate('Files') + return + } + }, [appState.features.hasFiles, premiumModal]) + + const toggleAttachedFilesMenuWithEntitlementCheck = useCallback(async () => { + prospectivelyShowFilesPremiumModal() + + await toggleAttachedFilesMenu() + }, [toggleAttachedFilesMenu, prospectivelyShowFilesPremiumModal]) const deleteFile = async (file: SNFile) => { const shouldDelete = await confirmDialog({ @@ -318,6 +326,7 @@ export const AttachedFilesButton: FunctionComponent = observer( setIsDraggingFiles(false) if (!appState.features.hasFiles) { + prospectivelyShowFilesPremiumModal() return } @@ -348,7 +357,14 @@ export const AttachedFilesButton: FunctionComponent = observer( dragCounter.current = 0 } }, - [appState.files, appState.features.hasFiles, attachFileToNote, currentTab, application], + [ + appState.files, + appState.features.hasFiles, + attachFileToNote, + currentTab, + application, + prospectivelyShowFilesPremiumModal, + ], ) useEffect(() => { @@ -367,7 +383,7 @@ export const AttachedFilesButton: FunctionComponent = observer( return (
- + { if (event.key === 'Escape') { diff --git a/app/assets/javascripts/Components/Preferences/Panes/Backups/FileBackups.tsx b/app/assets/javascripts/Components/Preferences/Panes/Backups/FileBackups.tsx index e31868b79..5736e53a8 100644 --- a/app/assets/javascripts/Components/Preferences/Panes/Backups/FileBackups.tsx +++ b/app/assets/javascripts/Components/Preferences/Panes/Backups/FileBackups.tsx @@ -9,7 +9,7 @@ import { } from '@/Components/Preferences/PreferencesComponents' import { useCallback, useEffect, useMemo, useState } from 'preact/hooks' import { Button } from '@/Components/Button/Button' -import { FileBackupMetadataFile, FileContent, FileHandleRead } from '@standardnotes/snjs' +import { FileBackupMetadataFile, FileBackupsConstantsV1, FileContent, FileHandleRead } from '@standardnotes/snjs' import { Switch } from '@/Components/Switch' import { HorizontalSeparator } from '@/Components/Shared/HorizontalSeparator' import { EncryptionStatusItem } from '../Security/Encryption' @@ -102,7 +102,7 @@ export const FileBackups = observer(({ application }: Props) => { <> Files backups are enabled. When you upload a new file on any device and open this application, files - will be downloaded in encrypted form to: + will be backed up in encrypted form to: = ({ application }) => { <> Backup Decryption - - Successfully decrypted metadata file for {decryptedFileContent.name}. - + ]} + checkmark={true} + />
1. Choose related data file - {droppedFile.file.uuid} + + {droppedFile.file.uuid}/{FileBackupsConstantsV1.BinaryFileName} +