@noya-app/noya-multiplayer-react 0.1.69 → 0.1.71

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/singleton.tsx CHANGED
@@ -24,6 +24,8 @@ export type AnyNoyaSingletonBindings = {
24
24
  inspector?: boolean | StateInspectorOptions;
25
25
  theme: AppTheme;
26
26
  viewType: AppViewType;
27
+ userId?: string;
28
+ isDemo: boolean;
27
29
  };
28
30
 
29
31
  export type AnyNoyaSingletonOptions<
@@ -75,6 +77,13 @@ export function initializeNoyaSingleton<
75
77
  managerOptions
76
78
  );
77
79
 
80
+ if (appData.userId) {
81
+ noyaManagerSingleton.ephemeralUserDataManager.setCurrentUserId(
82
+ appData.userId
83
+ );
84
+ noyaManagerSingleton.userManager.setCurrentUserId(appData.userId);
85
+ }
86
+
78
87
  const resolvedSync =
79
88
  sync ??
80
89
  getSyncAdapter<S, M, E, MenuT>({
@@ -108,6 +117,9 @@ export function initializeNoyaSingleton<
108
117
  anchor={
109
118
  resolvedInspector === true ? "bottom right" : resolvedInspector.anchor
110
119
  }
120
+ advanced={
121
+ resolvedInspector === true ? false : resolvedInspector.advanced
122
+ }
111
123
  />
112
124
  );
113
125
  }
@@ -117,6 +129,8 @@ export function initializeNoyaSingleton<
117
129
  inspector: resolvedInspector,
118
130
  theme: resolvedTheme,
119
131
  viewType: resolvedViewType,
132
+ userId: appData.userId,
133
+ isDemo: appData.isDemo,
120
134
  };
121
135
  }
122
136