mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-10-30 08:16:49 +00:00
store script state in hash and not query
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
import { inferArgs } from '$lib/infer'
|
||||
import { initialCode } from '$lib/script_helpers'
|
||||
import { enterpriseLicense, userStore, workerTags, workspaceStore } from '$lib/stores'
|
||||
import { emptySchema, encodeState, getModifierKey, setQueryWithoutLoad } from '$lib/utils'
|
||||
import { emptySchema, encodeState, getModifierKey } from '$lib/utils'
|
||||
import Path from './Path.svelte'
|
||||
import ScriptEditor from './ScriptEditor.svelte'
|
||||
import ScriptSchema from './ScriptSchema.svelte'
|
||||
@@ -117,9 +117,10 @@
|
||||
$page.url.searchParams.delete(x)
|
||||
}
|
||||
})
|
||||
setQueryWithoutLoad($page.url, [{ key: 'state', value: encodeState(script) }])
|
||||
}
|
||||
|
||||
$: window.history.replaceState(null, '', '#' + encodeState(script))
|
||||
|
||||
if (script.content == '') {
|
||||
initContent(script.language, script.kind, template)
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
const path = $page.url.searchParams.get('path')
|
||||
|
||||
const initialState = $page.url.searchParams.get('state')
|
||||
const initialState = $page.url.hash != '' ? $page.url.hash.slice(1) : undefined
|
||||
|
||||
let scriptBuilder: ScriptBuilder | undefined = undefined
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
import { sendUserToast } from '$lib/toast'
|
||||
import DiffDrawer from '$lib/components/DiffDrawer.svelte'
|
||||
|
||||
const initialState = $page.url.searchParams.get('state')
|
||||
const initialState = $page.url.hash != '' ? $page.url.hash.slice(1) : undefined
|
||||
let initialArgs = {}
|
||||
if ($runFormStore) {
|
||||
initialArgs = $runFormStore
|
||||
|
||||
Reference in New Issue
Block a user