Skip to content

Commit

Permalink
Merge pull request #45 from invopop/issigned_reactivity
Browse files Browse the repository at this point in the history
fix isSigned reactivity on load
  • Loading branch information
beliolfa authored Aug 24, 2023
2 parents 410e78a + 6d4290b commit aa7a2ed
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/lib/GOBLBuilder.svelte
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
<script lang="ts">
import { createEventDispatcher } from "svelte";
import { envelope, goblError, keypair, newEnvelope } from "$lib/editor/stores.js";
import {
envelope,
goblError,
keypair,
newEnvelope,
editorProblems,
jsonSchema,
validEditor,
} from "$lib/editor/stores.js";
import MenuBar from "./menubar/MenuBar.svelte";
import Editor from "./editor/Editor.svelte";
import { isEnvelope } from "@invopop/gobl-worker";
import { problemSeverityMap, type EditorProblem } from "./editor/EditorProblem.js";
import { editorProblems, jsonSchema, validEditor, envelopeIsSigned } from "./editor/stores.js";
import * as actions from "./editor/actions";
Expand Down Expand Up @@ -44,10 +51,7 @@
});
}
$: {
isValid = $validEditor;
isSigned = $envelopeIsSigned;
}
$: isValid = $validEditor;
// When `data` is updated, update the internal envelope store.
// If required instantiate a new envelope object to use.
Expand All @@ -71,6 +75,7 @@
// Dispatch all `change` events when the envelope is modified.
envelope.subscribe((envelope) => {
isSigned = Boolean(envelope?.sigs);
dispatch("change", { envelope: JSON.stringify(envelope) });
});
Expand Down

0 comments on commit aa7a2ed

Please sign in to comment.