chore: Ensure user is not connected to document when clearing cache
This commit is contained in:
@@ -8,6 +8,8 @@ import env from "~/env";
|
|||||||
import { client } from "~/utils/ApiClient";
|
import { client } from "~/utils/ApiClient";
|
||||||
import Logger from "~/utils/Logger";
|
import Logger from "~/utils/Logger";
|
||||||
import { deleteAllDatabases } from "~/utils/developer";
|
import { deleteAllDatabases } from "~/utils/developer";
|
||||||
|
import history from "~/utils/history";
|
||||||
|
import { homePath } from "~/utils/routeHelpers";
|
||||||
|
|
||||||
export const copyId = createAction({
|
export const copyId = createAction({
|
||||||
name: ({ t }) => t("Copy ID"),
|
name: ({ t }) => t("Copy ID"),
|
||||||
@@ -75,13 +77,14 @@ export const copyId = createAction({
|
|||||||
});
|
});
|
||||||
|
|
||||||
export const clearIndexedDB = createAction({
|
export const clearIndexedDB = createAction({
|
||||||
name: ({ t }) => t("Delete IndexedDB cache"),
|
name: ({ t }) => t("Clear IndexedDB cache"),
|
||||||
icon: <TrashIcon />,
|
icon: <TrashIcon />,
|
||||||
keywords: "cache clear database",
|
keywords: "cache clear database",
|
||||||
section: DeveloperSection,
|
section: DeveloperSection,
|
||||||
perform: async ({ t }) => {
|
perform: async ({ t }) => {
|
||||||
|
history.push(homePath());
|
||||||
await deleteAllDatabases();
|
await deleteAllDatabases();
|
||||||
toast.message(t("IndexedDB cache deleted"));
|
toast.success(t("IndexedDB cache cleared"));
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -11,8 +11,8 @@
|
|||||||
"Delete": "Delete",
|
"Delete": "Delete",
|
||||||
"Delete collection": "Delete collection",
|
"Delete collection": "Delete collection",
|
||||||
"Copy ID": "Copy ID",
|
"Copy ID": "Copy ID",
|
||||||
"Delete IndexedDB cache": "Delete IndexedDB cache",
|
"Clear IndexedDB cache": "Clear IndexedDB cache",
|
||||||
"IndexedDB cache deleted": "IndexedDB cache deleted",
|
"IndexedDB cache cleared": "IndexedDB cache cleared",
|
||||||
"Toggle debug logging": "Toggle debug logging",
|
"Toggle debug logging": "Toggle debug logging",
|
||||||
"Debug logging enabled": "Debug logging enabled",
|
"Debug logging enabled": "Debug logging enabled",
|
||||||
"Debug logging disabled": "Debug logging disabled",
|
"Debug logging disabled": "Debug logging disabled",
|
||||||
|
|||||||
Reference in New Issue
Block a user