Altered initialisation flow to ensure base state is correct for checking update status

This commit is contained in:
Dean 2023-05-15 09:38:59 +01:00
parent ea458639b3
commit 00d2bc4f6d
1 changed files with 13 additions and 8 deletions

View File

@ -1,5 +1,5 @@
<script> <script>
import { goto, beforeUrlChange, route } from "@roxi/routify" import { goto, beforeUrlChange } from "@roxi/routify"
import { import {
Icon, Icon,
Select, Select,
@ -45,11 +45,21 @@
let saveId let saveId
let currentTab = "JSON" let currentTab = "JSON"
let saveModal let saveModal
let queryStr = JSON.stringify(query)
let override = false let override = false
let navigateTo = null let navigateTo = null
// seed the transformer
if (query && !query.transformer) {
query.transformer = "return data"
}
// initialise a new empty schema
if (query && !query.schema) {
query.schema = {}
}
let queryStr = JSON.stringify(query)
$beforeUrlChange((event, targetRoute) => { $beforeUrlChange((event, targetRoute) => {
const updated = JSON.stringify(query) const updated = JSON.stringify(query)
@ -85,11 +95,6 @@
} }
} }
// seed the transformer
if (query && !query.transformer) {
query.transformer = "return data"
}
function resetDependentFields() { function resetDependentFields() {
if (query.fields.extra) { if (query.fields.extra) {
query.fields.extra = {} query.fields.extra = {}