fix: Race condition with setting awareness field

This commit is contained in:
Tom Moor committed 2023-09-20 23:48:14 -04:00
1 parent 27befbf3f7
commit 34d4209dd5
1 file changed
+1 -5
+1 -5
View File
@@ -32,11 +32,7 @@ export default class Multiplayer extends Extension {
}
};
// only once we have authenticated successfully do we initalize awareness.
// we could send this earlier, but getting authenticated faster is more important
provider.on("authenticated", () => {
provider.setAwarenessField("user", user);
});
provider.setAwarenessField("user", user);
// only once an actual change has been made do we add the userId <> clientId
// mapping, this avoids stored mappings for clients that never made a change