@aomi-labs/react 0.3.11 → 0.3.12
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/dist/index.cjs +20 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +20 -6
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1143,14 +1143,28 @@ function useRuntimeOrchestrator(aomiClient, options) {
|
|
|
1143
1143
|
(threadId) => {
|
|
1144
1144
|
var _a, _b, _c, _d, _e;
|
|
1145
1145
|
const manager = sessionManagerRef.current;
|
|
1146
|
+
const nextApp = options.getApp();
|
|
1147
|
+
const nextPublicKey = (_a = options.getPublicKey) == null ? void 0 : _a.call(options);
|
|
1148
|
+
const nextApiKey = (_c = (_b = options.getApiKey) == null ? void 0 : _b.call(options)) != null ? _c : void 0;
|
|
1149
|
+
const nextClientId = (_d = options.getClientId) == null ? void 0 : _d.call(options);
|
|
1150
|
+
const nextUserState = (_e = options.getUserState) == null ? void 0 : _e.call(options);
|
|
1146
1151
|
const existing = manager.get(threadId);
|
|
1147
|
-
if (existing)
|
|
1152
|
+
if (existing) {
|
|
1153
|
+
existing.syncRuntimeOptions({
|
|
1154
|
+
app: nextApp,
|
|
1155
|
+
publicKey: nextPublicKey,
|
|
1156
|
+
apiKey: nextApiKey,
|
|
1157
|
+
clientId: nextClientId,
|
|
1158
|
+
userState: nextUserState
|
|
1159
|
+
});
|
|
1160
|
+
return existing;
|
|
1161
|
+
}
|
|
1148
1162
|
const session = manager.getOrCreate(threadId, {
|
|
1149
|
-
app:
|
|
1150
|
-
publicKey:
|
|
1151
|
-
apiKey:
|
|
1152
|
-
clientId:
|
|
1153
|
-
userState:
|
|
1163
|
+
app: nextApp,
|
|
1164
|
+
publicKey: nextPublicKey,
|
|
1165
|
+
apiKey: nextApiKey,
|
|
1166
|
+
clientId: nextClientId,
|
|
1167
|
+
userState: nextUserState
|
|
1154
1168
|
});
|
|
1155
1169
|
const cleanups = [];
|
|
1156
1170
|
cleanups.push(
|