@frankieai/react 0.2.4 → 0.2.5
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 +11 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +11 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/chat/FrankieChatPage.tsx +11 -2
- package/src/hooks/useFrankieChat.ts +10 -2
package/dist/index.js
CHANGED
|
@@ -346,8 +346,11 @@ function useFrankieChatState() {
|
|
|
346
346
|
messagesRef.current = restoredMessages;
|
|
347
347
|
setMessages(restoredMessages);
|
|
348
348
|
}
|
|
349
|
-
} catch {
|
|
350
|
-
if (active)
|
|
349
|
+
} catch (caught) {
|
|
350
|
+
if (active) {
|
|
351
|
+
const message = caught instanceof FrankieApiError ? caught.message : caught instanceof Error && caught.message.startsWith("Frankie") ? caught.message : "Could not restore this conversation. Check your sign-in and connection, then try opening it again.";
|
|
352
|
+
setError(message);
|
|
353
|
+
}
|
|
351
354
|
} finally {
|
|
352
355
|
if (active) setRestored(true);
|
|
353
356
|
}
|
|
@@ -1372,8 +1375,12 @@ function PageChrome({ showHistory, navigation, currentId, onSelect, onNew, ...pa
|
|
|
1372
1375
|
try {
|
|
1373
1376
|
const items = await client.listConversations();
|
|
1374
1377
|
if (version === requestVersion.current) setConversations(items);
|
|
1375
|
-
} catch {
|
|
1376
|
-
if (version
|
|
1378
|
+
} catch (caught) {
|
|
1379
|
+
if (version !== requestVersion.current) {
|
|
1380
|
+
} else {
|
|
1381
|
+
const message = caught instanceof FrankieApiError ? caught.message : caught instanceof Error && caught.message.startsWith("Frankie") ? caught.message : "History couldn\u2019t load. Check your sign-in and try again.";
|
|
1382
|
+
setHistoryError(message);
|
|
1383
|
+
}
|
|
1377
1384
|
} finally {
|
|
1378
1385
|
if (version === requestVersion.current) setHistoryLoading(false);
|
|
1379
1386
|
}
|