refac
This commit is contained in:
@@ -33,14 +33,17 @@
|
|||||||
|
|
||||||
const init = async () => {
|
const init = async () => {
|
||||||
loading = true;
|
loading = true;
|
||||||
variableValues = {};
|
const newValues = {};
|
||||||
for (const variable of Object.keys(variables)) {
|
const keys = Object.keys(variables ?? {});
|
||||||
if (variables[variable]?.default !== undefined) {
|
for (const key of keys) {
|
||||||
variableValues[variable] = variables[variable].default;
|
const variable = variables[key];
|
||||||
|
if (variable?.default !== undefined) {
|
||||||
|
newValues[key] = variable.default;
|
||||||
} else {
|
} else {
|
||||||
variableValues[variable] = '';
|
newValues[key] = '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
variableValues = newValues;
|
||||||
loading = false;
|
loading = false;
|
||||||
|
|
||||||
await tick();
|
await tick();
|
||||||
|
|||||||
Reference in New Issue
Block a user