From 22f34150692ef1c655dd26ea4426944c7e8e5813 Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Sun, 1 May 2022 15:00:00 -0500 Subject: [PATCH] Fix adding new layers not allowing them to be displayed until refresh --- src/game/layers.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/game/layers.tsx b/src/game/layers.tsx index 85b7a17..cb7462a 100644 --- a/src/game/layers.tsx +++ b/src/game/layers.tsx @@ -17,7 +17,7 @@ import { } from "util/computed"; import { createLazyProxy } from "util/proxies"; import { createNanoEvents, Emitter } from "nanoevents"; -import { InjectionKey, Ref, ref, unref } from "vue"; +import { InjectionKey, Ref, ref, shallowReactive, unref } from "vue"; import { globalBus } from "./events"; import { Persistent, persistent } from "./persistence"; import player from "./player"; @@ -44,7 +44,7 @@ export interface LayerEvents { postUpdate: (diff: number) => void; } -export const layers: Record | undefined> = {}; +export const layers: Record | undefined> = shallowReactive({}); window.layers = layers; declare module "@vue/runtime-dom" {