From 17a033bfd9f8f7a685826bf69ef976aba75010cd Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Fri, 22 Jul 2022 21:54:37 -0500 Subject: [PATCH] Use ID to compare layers in trackResetTime --- src/features/reset.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/features/reset.ts b/src/features/reset.ts index 3a724e3..eaa3631 100644 --- a/src/features/reset.ts +++ b/src/features/reset.ts @@ -70,7 +70,7 @@ const listeners: Record = {}; export function trackResetTime(layer: BaseLayer, reset: GenericReset): Persistent { const resetTime = persistent(new Decimal(0)); globalBus.on("addLayer", layerBeingAdded => { - if (layer === layerBeingAdded) { + if (layer.id === layerBeingAdded.id) { listeners[layer.id]?.(); listeners[layer.id] = layer.on("preUpdate", diff => { resetTime.value = Decimal.add(resetTime.value, diff);