Try force updates when navigating between named routes

This commit is contained in:
2021-10-27 23:53:51 +02:00
parent f21714d05a
commit d89ff8c18e

View File

@@ -13,22 +13,20 @@
export async function load({ page: { params }, fetch }) { export async function load({ page: { params }, fetch }) {
const { hostname } = params; const { hostname } = params;
updated = unit?.hostname !== hostname
unit = getUnitFromHostname(hostname) unit = getUnitFromHostname(hostname)
return { return {
props: { props: {
unit unit,
updated
} }
}; };
} }
</script> </script>
<script lang="ts">
export let unit: IRack;
</script>
<div> <div>
{#if unit} {#if updated || unit}
<h2>{ unit.hostname }</h2> <h2>{ unit.hostname }</h2>
{#each JSON.stringify(unit).split(",") as segment} {#each JSON.stringify(unit).split(",") as segment}