refactor: use more explicit type check

This commit is contained in:
Richard 2024-09-20 02:11:10 -07:00
parent 4c1b60b17b
commit 99e2104eb2

View file

@ -44,7 +44,7 @@ local function client(options: ClientOptions): ClientSyncer
for index = 1, select("#", ...) do
local payload: SyncPayload = select(index, ...)
if ignoreUnhydrated and payload.type ~= "init" and not hydrated then
if ignoreUnhydrated and payload.type == "patch" and not hydrated then
-- If the client is not initialized, ignore patches. This is
-- to prevent patching incomplete state.
continue