@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.cjs
CHANGED
|
@@ -408,8 +408,11 @@ function useFrankieChatState() {
|
|
|
408
408
|
messagesRef.current = restoredMessages;
|
|
409
409
|
setMessages(restoredMessages);
|
|
410
410
|
}
|
|
411
|
-
} catch {
|
|
412
|
-
if (active)
|
|
411
|
+
} catch (caught) {
|
|
412
|
+
if (active) {
|
|
413
|
+
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.";
|
|
414
|
+
setError(message);
|
|
415
|
+
}
|
|
413
416
|
} finally {
|
|
414
417
|
if (active) setRestored(true);
|
|
415
418
|
}
|
|
@@ -1434,8 +1437,12 @@ function PageChrome({ showHistory, navigation, currentId, onSelect, onNew, ...pa
|
|
|
1434
1437
|
try {
|
|
1435
1438
|
const items = await client.listConversations();
|
|
1436
1439
|
if (version === requestVersion.current) setConversations(items);
|
|
1437
|
-
} catch {
|
|
1438
|
-
if (version
|
|
1440
|
+
} catch (caught) {
|
|
1441
|
+
if (version !== requestVersion.current) {
|
|
1442
|
+
} else {
|
|
1443
|
+
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.";
|
|
1444
|
+
setHistoryError(message);
|
|
1445
|
+
}
|
|
1439
1446
|
} finally {
|
|
1440
1447
|
if (version === requestVersion.current) setHistoryLoading(false);
|
|
1441
1448
|
}
|