Ensure invalid app IDs redirect properly without issues in portal

This commit is contained in:
Andrew Kingston 2023-09-06 16:22:47 +01:00
parent 3c3c4cf8b1
commit f972aa340a
2 changed files with 16 additions and 1 deletions

View File

@ -0,0 +1,15 @@
<script>
import { params, redirect } from "@roxi/routify"
import { apps } from "stores/portal"
$: app = $apps.find(app => app.appId === $params.appId)
$: {
if (!app) {
$redirect("../")
}
}
</script>
{#if app}
<slot />
{/if}

View File

@ -52,7 +52,7 @@
Fullscreen
</ActionButton>
</div>
<iframe src={iframeUrl} />
<iframe src={iframeUrl} title={app.name} />
</div>
<style>