fix: send init payload even if atom did not update

This commit is contained in:
littensy 2025-09-29 18:30:35 -07:00
parent 079abaacc1
commit 0dbc0587a0
2 changed files with 29 additions and 12 deletions

View file

@ -6,7 +6,6 @@ type SyncPayload = types.SyncPayload
local atomRegister: { [string]: Charm.Atom } = {}
--- @client
local function registerAtoms(atoms: { [string]: Charm.Atom })
for key, atom in atoms do
if atomRegister[key] and atomRegister[key] ~= atom then
@ -18,12 +17,10 @@ local function registerAtoms(atoms: { [string]: Charm.Atom })
end
end
--- @client
local function clearAtoms()
table.clear(atomRegister)
end
--- @client
local function unregisterAtoms(...: string)
for index = 1, select("#", ...) do
local key = select(index, ...)
@ -54,7 +51,6 @@ local function applyPatchPayload(data: { [string | number]: any })
end
end
--- @client
local function applyPayloads(payloads: { SyncPayload })
for _, payload in payloads do
if payload.type == "init" then