Skip to content

Commit

Permalink
Fix the file selection button
Browse files Browse the repository at this point in the history
  • Loading branch information
ltouroumov committed Jul 1, 2024
1 parent b67ce82 commit 98e3c29
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
<ul class="list-group mb-3">
<li class="list-group-item">
<a
href="https://raw.githubusercontent.com/ltouroumov/worm-cyoa-v6-fork/master/project-v17.json"
href="#"
data-fileurl="https://raw.githubusercontent.com/ltouroumov/worm-cyoa-v6-fork/master/project-v17.json"
@click.prevent="loadRemoteFile"
>
Worm V6 (Lt's Fork)
Expand Down Expand Up @@ -56,8 +57,9 @@ const isLoading = ref<boolean>(false);
const loadRemoteFile = async ({ target }: MouseEvent) => {
if (target && target instanceof HTMLAnchorElement) {
const fileURL = target.dataset.fileurl;
if (!fileURL) return;
isLoading.value = true;
const fileURL = target.href;
const result: any = await $fetch(fileURL, { parseResponse: JSON.parse });
loadProject(result, fileURL);
isLoading.value = false;
Expand Down

0 comments on commit 98e3c29

Please sign in to comment.