Show error dialog if specific app version can't be found
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
<script setup>
|
||||
|
||||
import { useI18n } from 'vue-i18n';
|
||||
const i18n = useI18n();
|
||||
const t = i18n.t;
|
||||
|
||||
import { ref, computed, useTemplateRef, onMounted } from 'vue';
|
||||
import { Button, TextInput, Spinner } from 'pankow';
|
||||
import { Button, TextInput, Spinner, InputDialog } from 'pankow';
|
||||
import AppstoreModel from '../models/AppstoreModel.js';
|
||||
import AppInstallDialog from '../components/AppInstallDialog.vue';
|
||||
import ApplinkDialog from '../components/ApplinkDialog.vue';
|
||||
@@ -35,6 +39,7 @@ const filteredPopularApps = computed(() => {
|
||||
const appInstallDialog = useTemplateRef('appInstallDialog');
|
||||
const searchInput = useTemplateRef('searchInput');
|
||||
const applinkDialog = useTemplateRef('applinkDialog');
|
||||
const inputDialog = useTemplateRef('inputDialog');
|
||||
|
||||
function onAppInstallDialogClose() {
|
||||
window.location.href = '#/appstore';
|
||||
@@ -84,7 +89,11 @@ onMounted(async () => {
|
||||
if (app) {
|
||||
appInstallDialog.value.open(app);
|
||||
} else {
|
||||
console.error('No such version found');
|
||||
inputDialog.value.info({
|
||||
title: t('appstore.appNotFoundDialog.title'),
|
||||
message: t('appstore.appNotFoundDialog.description', { appId, version }),
|
||||
confirmLabel: t('main.dialog.close'),
|
||||
});
|
||||
}
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
@@ -102,6 +111,7 @@ onMounted(async () => {
|
||||
|
||||
<template>
|
||||
<div class="content" style="width: 100%;">
|
||||
<InputDialog ref="inputDialog"/>
|
||||
<AppInstallDialog ref="appInstallDialog" @close="onAppInstallDialogClose"/>
|
||||
<ApplinkDialog ref="applinkDialog" @success="onApplinkDialogSuccess()"/>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user