diff --git a/ui/src/components/DropdownTitle.tsx b/ui/src/components/DropdownTitle.tsx
index b9c51b3..85f8025 100644
--- a/ui/src/components/DropdownTitle.tsx
+++ b/ui/src/components/DropdownTitle.tsx
@@ -26,6 +26,7 @@ import {
DarkMode,
Tag,
HStack,
+ useToast,
} from "@chakra-ui/react";
import {
IconArrowBackUpDouble,
@@ -33,6 +34,7 @@ import {
IconDeviceFloppy,
IconDownload,
IconHistory,
+ IconLink,
IconShare2,
IconVersions,
} from "@tabler/icons-react";
@@ -83,7 +85,7 @@ export default function DropdownTitle() {
setNewFlowName(event.target.value);
submitError && setSubmitError("");
};
-
+ const toast = useToast();
const onSubmit = async () => {
if (!curFlowID) {
alert("Flow ID is required");
@@ -194,6 +196,31 @@ export default function DropdownTitle() {
+
}
diff --git a/ui/src/db-tables/WorkspaceDB.ts b/ui/src/db-tables/WorkspaceDB.ts
index 2dc0575..c29353d 100644
--- a/ui/src/db-tables/WorkspaceDB.ts
+++ b/ui/src/db-tables/WorkspaceDB.ts
@@ -61,86 +61,4 @@ export async function loadDBs() {
loadMedia(),
loadWorkflowVersions(),
]);
- if (localStorage.getItem("WORKSPACE_INDEXDB_BACKFILL") !== "true") {
- await backfillIndexdb();
- localStorage.setItem("WORKSPACE_INDEXDB_BACKFILL", "true");
- }
-}
-
-export async function backfillIndexdb() {
- const backfillWorkflows = async () => {
- try {
- const all = await workflowsTable?.getRecords();
- all && (await indexdb.workflows.bulkPut(Object.values(all)));
- } catch (error) {
- console.error(error);
- }
- };
- const backfillFolders = async () => {
- try {
- const all = await foldersTable?.getRecords();
- all && (await indexdb.folders.bulkPut(Object.values(all)));
- } catch (error) {
- console.error(error);
- }
- };
- const backfillMedia = async () => {
- try {
- const all = await mediaTable?.getRecords();
- all && (await indexdb.media.bulkPut(Object.values(all)));
- } catch (error) {
- console.error(error);
- }
- };
- const backfillChangelogs = async () => {
- try {
- const all = await changelogsTable?.getRecords();
- all && (await indexdb.changelogs.bulkPut(Object.values(all)));
- } catch (error) {
- console.error(error);
- }
- };
- const backfillTags = async () => {
- try {
- const all = await tagsTable?.getRecords();
- all && (await indexdb.tags.bulkPut(Object.values(all)));
- } catch (error) {
- console.error(error);
- }
- };
- const backfillUserSettings = async () => {
- try {
- const tableInstance = userSettingsTable!;
- const backupData = await tableInstance.getRecords().then((data) => {
- if (!data[tableInstance.DEFAULT_USER]) {
- // legacy
- return data;
- }
- return data[tableInstance.DEFAULT_USER];
- });
- await indexdb.userSettings.put({
- ...tableInstance.defaultSettings,
- ...backupData,
- });
- } catch (error) {
- console.error(error);
- }
- };
- const backfillWorkflowVersions = async () => {
- try {
- const all = await workflowVersionsTable?.getRecords();
- all && (await indexdb.workflowVersions.bulkPut(Object.values(all)));
- } catch (error) {
- console.error(error);
- }
- };
- await Promise.all([
- backfillWorkflows(),
- backfillFolders(),
- backfillMedia(),
- backfillChangelogs(),
- backfillTags(),
- backfillUserSettings(),
- backfillWorkflowVersions(),
- ]);
}