Skip to content

Commit

Permalink
Stub file download?
Browse files Browse the repository at this point in the history
  • Loading branch information
zvecr committed Sep 22, 2024
1 parent 8783f26 commit 81ce9df
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/Compile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import { ref } from 'vue'
import { useFetch, useIntervalFn } from '@vueuse/core'
import { useKeymapState } from '@/composables/useKeymapState'
import { saveAs } from 'file-saver';
// import { saveAs } from 'file-saver';
const { keymap } = useKeymapState()
Expand All @@ -42,12 +42,12 @@ const jobID = ref('')
const { pause, resume } = useIntervalFn(async () => {
const { data } = await useFetch(`https://api.qmk.fm/v1/compile/${jobID.value}`).get().json()
console.log(data.value);
if(data.value.status === 'finished') {
abort();
saveAs(`https://api.qmk.fm/v1/compile/${jobID.value}/download`, data.value.result.firmware_filename);
// TODO: betterer firmware download
// saveAs(`https://api.qmk.fm/v1/compile/${jobID.value}/download`, data.value.result.firmware_filename);
window.open(`https://api.qmk.fm/v1/compile/${jobID.value}/download`, '_blank')
}
}, 2500, {immediate: false})
Expand Down

0 comments on commit 81ce9df

Please sign in to comment.