We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 93415a4 commit 0dcd6acCopy full SHA for 0dcd6ac
1 file changed
src/lib/components/chat/MessageInput/InputVariablesModal.svelte
@@ -33,14 +33,17 @@
33
34
const init = async () => {
35
loading = true;
36
- variableValues = {};
37
- for (const variable of Object.keys(variables)) {
38
- if (variables[variable]?.default !== undefined) {
39
- variableValues[variable] = variables[variable].default;
+ const newValues = {};
+ const keys = Object.keys(variables ?? {});
+ for (const key of keys) {
+ const variable = variables[key];
40
+ if (variable?.default !== undefined) {
41
+ newValues[key] = variable.default;
42
} else {
- variableValues[variable] = '';
43
+ newValues[key] = '';
44
}
45
46
+ variableValues = newValues;
47
loading = false;
48
49
await tick();
0 commit comments