diff --git a/src/admin/ClearCacheButton.tsx b/src/admin/ClearCacheButton.tsx
index 7855bf4c..7493a3d5 100644
--- a/src/admin/ClearCacheButton.tsx
+++ b/src/admin/ClearCacheButton.tsx
@@ -4,18 +4,24 @@ import SubmitButtonWithStatus from '@/components/SubmitButtonWithStatus';
import { clearCacheAction } from '@/photo/actions';
import { useAppState } from '@/app/AppState';
import { BiTrash } from 'react-icons/bi';
+import { useAppText } from '@/i18n/state/client';
+import { toastSuccess } from '@/toast';
export default function ClearCacheButton() {
const { invalidateSwr } = useAppState();
+ const appText = useAppText();
return (
);
diff --git a/src/cmdk/CommandKClient.tsx b/src/cmdk/CommandKClient.tsx
index 7abbd5d8..243242e9 100644
--- a/src/cmdk/CommandKClient.tsx
+++ b/src/cmdk/CommandKClient.tsx
@@ -97,6 +97,8 @@ import IconSort from '@/components/icons/IconSort';
import { useSelectPhotosState } from '@/admin/select/SelectPhotosState';
import IconAlbum from '@/components/icons/IconAlbum';
import usePhotoQuery from '@/photo/usePhotoQuery';
+import { clearCacheAction } from '@/photo/actions';
+import { toastSuccess } from '@/toast';
const DIALOG_TITLE = 'Global Command-K Menu';
const DIALOG_DESCRIPTION = 'For searching photos, views, and settings';
@@ -160,6 +162,7 @@ export default function CommandKClient({
clearAuthStateAndRedirectIfNecessary,
isCommandKOpen: isOpen,
startUpload,
+ invalidateSwr,
photosCountTotal,
photosCountHidden = 0,
uploadsCount,
@@ -650,6 +653,14 @@ export default function CommandKClient({
stopSelectingPhotos?.();
}
},
+ }, {
+ label: appText.admin.clearCache,
+ annotation: ,
+ action: () => clearCacheAction()
+ .then(() => {
+ invalidateSwr?.();
+ toastSuccess(appText.admin.clearCacheSuccess);
+ }),
}, {
label:
{appText.admin.appInsights}
diff --git a/src/i18n/locales/bd-bn.ts b/src/i18n/locales/bd-bn.ts
index c255d8ed..46bb41a6 100644
--- a/src/i18n/locales/bd-bn.ts
+++ b/src/i18n/locales/bd-bn.ts
@@ -141,6 +141,8 @@ export const TEXT: I18N = {
selectPhotosExit: 'নির্বাচন বন্ধ করুন',
appInsights: 'অ্যাপ ইনসাইট',
appConfig: 'অ্যাপ কনফিগারেশন',
+ clearCache: 'ক্যাশ সাফ করুন',
+ clearCacheSuccess: 'সাইট ক্যাশ সাফ করা হয়েছে',
edit: 'এডিট',
favorite: 'পছন্দ',
unfavorite: 'পছন্দ অপসারণ',
diff --git a/src/i18n/locales/en-gb.ts b/src/i18n/locales/en-gb.ts
index b85633d9..dc8e7dff 100644
--- a/src/i18n/locales/en-gb.ts
+++ b/src/i18n/locales/en-gb.ts
@@ -141,6 +141,8 @@ export const TEXT: I18N = {
selectPhotosExit: 'Stop Selecting',
appInsights: 'App Insights',
appConfig: 'App Configuration',
+ clearCache: 'Clear Cache',
+ clearCacheSuccess: 'Site cache has been cleared',
edit: 'Edit',
favorite: 'Favourite',
unfavorite: 'Unfavourite',
diff --git a/src/i18n/locales/en-us.ts b/src/i18n/locales/en-us.ts
index 29104d1c..e5fa5ee2 100644
--- a/src/i18n/locales/en-us.ts
+++ b/src/i18n/locales/en-us.ts
@@ -140,6 +140,8 @@ export const TEXT = {
selectPhotosExit: 'Stop Selecting',
appInsights: 'App Insights',
appConfig: 'App Configuration',
+ clearCache: 'Clear Cache',
+ clearCacheSuccess: 'Site cache has been cleared',
edit: 'Edit',
favorite: 'Favorite',
unfavorite: 'Unfavorite',
diff --git a/src/i18n/locales/es-es.ts b/src/i18n/locales/es-es.ts
index e131dad9..7ea06bee 100644
--- a/src/i18n/locales/es-es.ts
+++ b/src/i18n/locales/es-es.ts
@@ -141,6 +141,8 @@ export const TEXT: I18N = {
selectPhotosExit: 'Dejar de Seleccionar',
appInsights: 'Estadísticas de la aplicación',
appConfig: 'Configuración de la aplicación',
+ clearCache: 'Limpiar caché',
+ clearCacheSuccess: 'La caché del sitio se ha borrado',
edit: 'Editar',
favorite: 'Marcar como favorito',
unfavorite: 'Quitar de favoritos',
diff --git a/src/i18n/locales/hi-in.ts b/src/i18n/locales/hi-in.ts
index 5cf0ef77..f11c06e0 100644
--- a/src/i18n/locales/hi-in.ts
+++ b/src/i18n/locales/hi-in.ts
@@ -141,6 +141,8 @@ export const TEXT: I18N = {
selectPhotosExit: 'चयन बंद करें',
appInsights: 'ऐप इनसाइट्स',
appConfig: 'ऐप कॉन्फ़िगरेशन',
+ clearCache: 'कैश साफ़ करें',
+ clearCacheSuccess: 'साइट कैश साफ़ हो गया है',
edit: 'संपादित करें',
favorite: 'पसंदीदा',
unfavorite: 'पसंदीदा नहीं',
diff --git a/src/i18n/locales/id-id.ts b/src/i18n/locales/id-id.ts
index ef3f02e2..85391ff8 100644
--- a/src/i18n/locales/id-id.ts
+++ b/src/i18n/locales/id-id.ts
@@ -141,6 +141,8 @@ export const TEXT: I18N = {
selectPhotosExit: 'Berhenti Memilih',
appInsights: 'Wawasan Aplikasi',
appConfig: 'Konfigurasi Aplikasi',
+ clearCache: 'Bersihkan Cache',
+ clearCacheSuccess: 'Cache situs telah dibersihkan',
edit: 'Edit',
favorite: 'Favorit',
unfavorite: 'Hapus dari Favorit',
diff --git a/src/i18n/locales/pt-br.ts b/src/i18n/locales/pt-br.ts
index 082137aa..59e78b89 100644
--- a/src/i18n/locales/pt-br.ts
+++ b/src/i18n/locales/pt-br.ts
@@ -141,6 +141,8 @@ export const TEXT: I18N = {
selectPhotosExit: 'Parar de Selecionar',
appInsights: 'Insights do aplicativo',
appConfig: 'Configuração da aplicação',
+ clearCache: 'Limpar cache',
+ clearCacheSuccess: 'O cache do site foi limpo',
edit: 'Editar',
favorite: 'Favoritar',
unfavorite: 'Remover dos favoritos',
diff --git a/src/i18n/locales/pt-pt.ts b/src/i18n/locales/pt-pt.ts
index 251c5727..78f1acea 100644
--- a/src/i18n/locales/pt-pt.ts
+++ b/src/i18n/locales/pt-pt.ts
@@ -141,6 +141,8 @@ export const TEXT: I18N = {
selectPhotosExit: 'Parar de Selecionar',
appInsights: 'Insights do aplicativo',
appConfig: 'Configuração da aplicação',
+ clearCache: 'Limpar cache',
+ clearCacheSuccess: 'A cache do site foi limpa',
edit: 'Editar',
favorite: 'Favoritar',
unfavorite: 'Remover dos favoritos',
diff --git a/src/i18n/locales/tr-tr.ts b/src/i18n/locales/tr-tr.ts
index 41760500..c261f5a8 100644
--- a/src/i18n/locales/tr-tr.ts
+++ b/src/i18n/locales/tr-tr.ts
@@ -141,6 +141,8 @@ export const TEXT: I18N = {
selectPhotosExit: 'Seçmeyi Durdur',
appInsights: 'Uygulama Analizi',
appConfig: 'Uygulama Yapılandırması',
+ clearCache: 'Önbelleği Temizle',
+ clearCacheSuccess: 'Site önbelleği temizlendi',
edit: 'Düzenle',
favorite: 'Favori',
unfavorite: 'Favoriden Çıkar',
diff --git a/src/i18n/locales/vi-vn.ts b/src/i18n/locales/vi-vn.ts
index 6a112fed..84ad23e1 100644
--- a/src/i18n/locales/vi-vn.ts
+++ b/src/i18n/locales/vi-vn.ts
@@ -141,6 +141,8 @@ export const TEXT: I18N = {
selectPhotosExit: 'Dừng chọn',
appInsights: 'Thống kê ứng dụng',
appConfig: 'Cấu hình ứng dụng',
+ clearCache: 'Xóa bộ nhớ cache',
+ clearCacheSuccess: 'Đã xóa bộ nhớ cache của trang web',
edit: 'Chỉnh sửa',
favorite: 'Yêu thích',
unfavorite: 'Bỏ yêu thích',
diff --git a/src/i18n/locales/zh-cn.ts b/src/i18n/locales/zh-cn.ts
index 86fe1e0c..e9647a04 100644
--- a/src/i18n/locales/zh-cn.ts
+++ b/src/i18n/locales/zh-cn.ts
@@ -141,6 +141,8 @@ export const TEXT: I18N = {
selectPhotosExit: '停止选择',
appInsights: '应用分析',
appConfig: '应用配置',
+ clearCache: '清除缓存',
+ clearCacheSuccess: '站点缓存已清除',
edit: '编辑',
favorite: '收藏',
unfavorite: '取消收藏',
diff --git a/src/toast/ToasterWithThemes.tsx b/src/toast/ToasterWithThemes.tsx
index 432f7c8d..4d7f2412 100644
--- a/src/toast/ToasterWithThemes.tsx
+++ b/src/toast/ToasterWithThemes.tsx
@@ -8,15 +8,15 @@ export default function ToasterWithThemes() {
const { resolvedTheme } = useTheme();
return (
toast(
message, {
- icon: ,
+ icon: ,
duration,
},
);
@@ -21,7 +24,10 @@ export const toastWarning = (
duration = DEFAULT_DURATION,
) => toast(
message, {
- icon: ,
+ icon: ,
duration,
},
);