permitir corregir mundos con contraseña incorrecta
This commit is contained in:
parent
feefdc7a1e
commit
fb943e43df
1 changed files with 5 additions and 1 deletions
|
@ -7,7 +7,11 @@
|
||||||
|
|
||||||
async function addWorld() {
|
async function addWorld() {
|
||||||
const password = location.hash.slice(1);
|
const password = location.hash.slice(1);
|
||||||
await writeWorlds((worlds) => [...worlds, { room: worldId, password }]);
|
await writeWorlds((worlds) => [
|
||||||
|
// reemplazar mundo en vez de agregar nuevo, por si se agregó antes con la contraseña incorrecta
|
||||||
|
...worlds.filter(({ room }) => room !== worldId),
|
||||||
|
{ room: worldId, password },
|
||||||
|
]);
|
||||||
router.route(inject(routes.Page, { worldId, pageId: "index" }));
|
router.route(inject(routes.Page, { worldId, pageId: "index" }));
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in a new issue