Skip to content
Snippets Groups Projects
Commit db687d32 authored by Konrad Mohrfeldt's avatar Konrad Mohrfeldt :koala:
Browse files

fix: don’t throw unhandled errors

parent 0b9f9269
No related branches found
No related tags found
No related merge requests found
......@@ -138,20 +138,20 @@
</div>
<APermissionGuard show-permissions="program.add__stream">
<GetStreamUrl v-slot="{ resolve, reject }">
<AStreamURLDialog @save="resolve($event)" @close="reject(undefined)" />
<GetStreamUrl v-slot="{ resolve }">
<AStreamURLDialog @save="resolve($event)" @close="resolve(null)" />
</GetStreamUrl>
</APermissionGuard>
<APermissionGuard show-permissions="program.add__import">
<GetFileImportUrl v-slot="{ resolve, reject }">
<AFileUrlDialog @save="resolve($event)" @close="reject(undefined)" />
<GetFileImportUrl v-slot="{ resolve }">
<AFileUrlDialog @save="resolve($event)" @close="resolve(null)" />
</GetFileImportUrl>
</APermissionGuard>
<APermissionGuard show-permissions="program.add__line">
<GetInputUrl v-slot="{ resolve, reject }">
<AInputUrlDialog @save="resolve($event)" @close="reject(undefined)" />
<GetInputUrl v-slot="{ resolve }">
<AInputUrlDialog @save="resolve($event)" @close="resolve(null)" />
</GetInputUrl>
</APermissionGuard>
</template>
......@@ -198,9 +198,9 @@ const { t } = useI18n()
const fileStore = useFilesStore()
const playlistStore = usePlaylistStore()
const GetStreamUrl = createTemplatePromise<string>()
const GetFileImportUrl = createTemplatePromise<string>()
const GetInputUrl = createTemplatePromise<string>()
const GetStreamUrl = createTemplatePromise<string | null>()
const GetFileImportUrl = createTemplatePromise<string | null>()
const GetInputUrl = createTemplatePromise<string | null>()
const entries = useCopy(() => props.playlist?.entries ?? [], {
save: () => updatePlaylistEntries(),
......@@ -287,6 +287,7 @@ async function uploadFiles(files: File[]) {
async function importFileFromURL() {
const fileUrl = await GetFileImportUrl.start()
if (!fileUrl) return
const tankFile = await fileStore.importFileURL(fileUrl, props.show, {
onDone: (tankFile) => uploadedFiles.value.delete(tankFile.id),
onCreate: (tankFile) => {
......@@ -313,11 +314,13 @@ async function addFileToPlaylist(...files: TankFile[]) {
async function addStreamToPlaylist() {
const streamURL = await GetStreamUrl.start()
if (!streamURL) return
await updatePlaylistEntries({ uri: streamURL })
}
async function addInputToPlaylist() {
const inputUrl = await GetInputUrl.start()
if (!inputUrl) return
await updatePlaylistEntries({ uri: inputUrl })
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment