enh: load tool by url

This commit is contained in:
Timothy Jaeryang Baek
2025-05-29 02:08:54 +04:00
parent 4461122a0e
commit 85a384fab5
6 changed files with 244 additions and 12 deletions
+5 -1
View File
@@ -13,6 +13,7 @@
exportFunctions,
getFunctionById,
getFunctions,
loadFunctionByUrl,
toggleFunctionById,
toggleGlobalById
} from '$lib/apis/functions';
@@ -34,7 +35,7 @@
import ChevronRight from '../icons/ChevronRight.svelte';
import XMark from '../icons/XMark.svelte';
import AddFunctionMenu from './Functions/AddFunctionMenu.svelte';
import ImportModal from './Functions/ImportModal.svelte';
import ImportModal from '../ImportModal.svelte';
const i18n = getContext('i18n');
@@ -203,6 +204,9 @@
<ImportModal
bind:show={showImportModal}
loadUrlHandler={async (url) => {
return await loadFunctionByUrl(localStorage.token, url);
}}
onImport={(func) => {
sessionStorage.function = JSON.stringify({
...func