usar inject en vez de hackily replace

This commit is contained in:
Cat /dev/Nulo 2023-03-05 21:49:23 +00:00
parent 3a2aad4d23
commit dc99cbfb9e

View file

@ -1,4 +1,5 @@
<script lang="ts"> <script lang="ts">
import { inject } from "regexparam";
import { loadWorlds } from "../lib/worldStorage"; import { loadWorlds } from "../lib/worldStorage";
import { routes } from "../lib/routes"; import { routes } from "../lib/routes";
@ -13,10 +14,10 @@
{#each worlds as world} {#each worlds as world}
<li> <li>
<a <a
href={routes.Page.replace(":worldId", world.room).replace( href={inject(routes.Page, {
":pageId", worldId: world.room,
"index" pageId: "index",
)}>{world.room}</a })}>{world.room}</a
> >
</li> </li>
{/each} {/each}