From c8aa8e37cfee0d35587ccf60c9607916117c8bc6 Mon Sep 17 00:00:00 2001 From: Abdullah Atta Date: Mon, 22 Jul 2024 15:30:21 +0500 Subject: [PATCH] web: add support for clearing attachments cache --- apps/web/src/components/icons/index.tsx | 4 +- apps/web/src/dialogs/attachments-dialog.tsx | 119 ++++++++++++++------ 2 files changed, 88 insertions(+), 35 deletions(-) diff --git a/apps/web/src/components/icons/index.tsx b/apps/web/src/components/icons/index.tsx index a754554c9..6ce6253c0 100644 --- a/apps/web/src/components/icons/index.tsx +++ b/apps/web/src/components/icons/index.tsx @@ -213,7 +213,8 @@ import { mdiFormatListBulleted, mdiLink, mdiWindowClose, - mdiFileMusicOutline + mdiFileMusicOutline, + mdiBroom } from "@mdi/js"; import { useTheme } from "@emotion/react"; import { Theme } from "@notesnook/theme"; @@ -548,3 +549,4 @@ export const WindowRestore = createIcon( "M8 16V4h12v12Zm2-2h8V6h-8Zm-6 6V8.525h2V18h9.475v2Zm6-6V6v8Z" ); export const WindowClose = createIcon(mdiWindowClose); +export const ClearCache = createIcon(mdiBroom); diff --git a/apps/web/src/dialogs/attachments-dialog.tsx b/apps/web/src/dialogs/attachments-dialog.tsx index ffd39f42e..77dd8c37f 100644 --- a/apps/web/src/dialogs/attachments-dialog.tsx +++ b/apps/web/src/dialogs/attachments-dialog.tsx @@ -34,6 +34,7 @@ import Dialog from "../components/dialog"; import { ChevronDown, ChevronUp, + ClearCache, Close, DoubleCheckmark, Download, @@ -63,6 +64,8 @@ import { } from "../components/virtualized-table"; import { FlexScrollContainer } from "../components/scroll-container"; import { BaseDialogProps, DialogManager } from "../common/dialog-manager"; +import { ConfirmDialog } from "./confirm"; +import { showToast } from "../utils/toast"; type ToolbarAction = { title: string; @@ -233,7 +236,11 @@ export const AttachmentsDialog = DialogManager.register( {attachments && ( )} - + }} + > + + + +