Skip to content

Commit c63f15d

Browse files
committed
Fix retrieveDoc failing on empty URLs.
1 parent a91d7b7 commit c63f15d

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

playground/next/editor.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,7 @@ window.app = createApp({
395395
},
396396
// methods
397397
async retrieveDoc(_editor, docVar, url) {
398+
if (!url) return;
398399
try {
399400
const rv = await fetch(url);
400401
if (!rv.ok) {

playground/next/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ <h2 class="ui massive header">JSON-LD Playground</h2>
131131
<div class="ui icon input">
132132
<input type="text" placeholder="Document URL"
133133
v-model="remoteDocURL" @keyup.enter="retrieveDoc(mainEditor, 'doc', remoteDocURL)">
134-
<i class="file link icon" @click="retrieveDoc(mainEditor, 'doc', remoteDocURL)"></i>
134+
<i class="file link icon" :class="{ disabled: remoteDocURL == '' }" @click="retrieveDoc(mainEditor, 'doc', remoteDocURL)"></i>
135135
</div>
136136
</div>
137137
</div>

0 commit comments

Comments
 (0)