Skip to content

Commit a91d7b7

Browse files
committed
Properly set defaults when URL params are absent.
1 parent 0c3664f commit a91d7b7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

playground/next/editor.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ window.app = createApp({
573573
// the `json-ld` parameter can be JSON or a URL
574574
const jsonLdOrUrl = hash.get('json-ld');
575575
try {
576-
this.doc = JSON.parse(jsonLdOrUrl);
576+
this.doc = JSON.parse(jsonLdOrUrl) || this.doc;
577577
setEditorValue(this.mainEditor, this.doc);
578578
} catch {
579579
this.remoteDocURL = jsonLdOrUrl;
@@ -582,6 +582,6 @@ window.app = createApp({
582582
if (hash.get('copyContext') === 'true') {
583583
this.copyContext();
584584
}
585-
this.outputTab = hash.get('startTab')?.slice(4);
585+
this.outputTab = hash.get('startTab')?.slice(4) || this.outputTab;
586586
}
587587
}).mount();

0 commit comments

Comments
 (0)