diff --git a/packages/web/src/javascripts/Components/FileContextMenu/FileContextMenuBackupOption.tsx b/packages/web/src/javascripts/Components/FileContextMenu/FileContextMenuBackupOption.tsx index 85f9fbab8..21e033fb2 100644 --- a/packages/web/src/javascripts/Components/FileContextMenu/FileContextMenuBackupOption.tsx +++ b/packages/web/src/javascripts/Components/FileContextMenu/FileContextMenuBackupOption.tsx @@ -9,11 +9,20 @@ export const FileContextMenuBackupOption: FunctionComponent<{ file: FileItem }> const application = useApplication() const [backupInfo, setBackupInfo] = useState(undefined) + const [backupAbsolutePath, setBackupAbsolutePath] = useState(undefined) useEffect(() => { void application.fileBackups?.getFileBackupInfo(file).then(setBackupInfo) }, [application, file]) + useEffect(() => { + if (!backupInfo) { + return + } + + void application.fileBackups?.getFileBackupAbsolutePath(backupInfo).then(setBackupAbsolutePath) + }, [backupInfo, application]) + const openFileBackup = useCallback(() => { if (backupInfo) { void application.fileBackups?.openFileBackup(backupInfo) @@ -35,7 +44,7 @@ export const FileContextMenuBackupOption: FunctionComponent<{ file: FileItem }> >
Backed up on {dateToStringStyle1(backupInfo.backedUpOn)}
-
{application.fileBackups?.getFileBackupAbsolutePath(backupInfo)}
+
{backupAbsolutePath}
)}