@decentnetwork/beagle-ui 0.2.8 → 0.2.10
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/beagle-ui.js +9 -5
- package/package.json +1 -1
package/dist/beagle-ui.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const BEAGLE_UI_VERSION = "0.2.
|
|
1
|
+
export const BEAGLE_UI_VERSION = "0.2.10";
|
|
2
2
|
// src/icons.jsx
|
|
3
3
|
var ICON_PATHS = {
|
|
4
4
|
// ---- tab bar (the four must feel like one set) ----
|
|
@@ -384,11 +384,13 @@ function useDaemonData() {
|
|
|
384
384
|
const t = setInterval(refresh, 2500);
|
|
385
385
|
return () => clearInterval(t);
|
|
386
386
|
}, [refresh]);
|
|
387
|
+
const inFlight = React.useRef(/* @__PURE__ */ new Set());
|
|
387
388
|
const loadThread = React.useCallback(async (peerId) => {
|
|
388
|
-
if (!peerId)
|
|
389
|
+
if (!peerId || inFlight.current.has(peerId))
|
|
389
390
|
return;
|
|
391
|
+
inFlight.current.add(peerId);
|
|
390
392
|
try {
|
|
391
|
-
const d = await dkGet("/api/chat-history?peer=" + encodeURIComponent(peerId));
|
|
393
|
+
const d = await dkGet("/api/chat-history?peer=" + encodeURIComponent(peerId) + "&limit=200");
|
|
392
394
|
const arr = d.chats && d.chats[peerId] || [];
|
|
393
395
|
await prefetchThreadFiles(arr);
|
|
394
396
|
const msgs = arr.map((m) => ({
|
|
@@ -421,6 +423,8 @@ function useDaemonData() {
|
|
|
421
423
|
const withDay = msgs.length ? [{ day: dkDayLabel(arr[0].ts) }].concat(msgs) : [];
|
|
422
424
|
setThreads((t) => Object.assign({}, t, { [peerId]: withDay }));
|
|
423
425
|
} catch (e) {
|
|
426
|
+
} finally {
|
|
427
|
+
inFlight.current.delete(peerId);
|
|
424
428
|
}
|
|
425
429
|
}, []);
|
|
426
430
|
return Object.assign({}, snap, { threads, refresh, loadThread });
|
|
@@ -4779,7 +4783,7 @@ var STR = {
|
|
|
4779
4783
|
updRestart: "Restart",
|
|
4780
4784
|
updBusy: "Updating\u2026 (about a minute)",
|
|
4781
4785
|
updDone: "Updated \u2014 restart to apply.",
|
|
4782
|
-
updRestarting: "Restarting\u2026 this page reloads when it\u2019s back. (If
|
|
4786
|
+
updRestarting: "Restarting\u2026 this page reloads when it\u2019s back. (If it has not come back after a minute, run beagle again.)",
|
|
4783
4787
|
updNpx: "Running via npx \u2014 restarting picks up the latest version automatically.",
|
|
4784
4788
|
updDev: "Running from a source checkout \u2014 update with:",
|
|
4785
4789
|
updPeerDaemon: "The peer version belongs to the running agentnet daemon, not to this app. Update it with:",
|
|
@@ -4961,7 +4965,7 @@ var STR = {
|
|
|
4961
4965
|
updRestart: "\u91CD\u542F",
|
|
4962
4966
|
updBusy: "\u66F4\u65B0\u4E2D\u2026(\u7EA6\u4E00\u5206\u949F)",
|
|
4963
4967
|
updDone: "\u66F4\u65B0\u5B8C\u6210\u2014\u2014\u91CD\u542F\u540E\u751F\u6548\u3002",
|
|
4964
|
-
updRestarting: "\u6B63\u5728\u91CD\u542F\u2026\u5B8C\u6210\u540E\u672C\u9875\u4F1A\u81EA\u52A8\u5237\u65B0\u3002(\u5982\u679C
|
|
4968
|
+
updRestarting: "\u6B63\u5728\u91CD\u542F\u2026\u5B8C\u6210\u540E\u672C\u9875\u4F1A\u81EA\u52A8\u5237\u65B0\u3002(\u5982\u679C\u4E00\u5206\u949F\u540E\u8FD8\u6CA1\u56DE\u6765,\u8BF7\u91CD\u65B0\u8FD0\u884C\u4E00\u6B21 beagle\u3002)",
|
|
4965
4969
|
updNpx: "\u4F60\u662F\u7528 npx \u8FD0\u884C\u7684\u2014\u2014\u91CD\u542F\u5373\u81EA\u52A8\u83B7\u53D6\u6700\u65B0\u7248\u3002",
|
|
4966
4970
|
updDev: "\u5F53\u524D\u4ECE\u6E90\u7801\u76EE\u5F55\u8FD0\u884C,\u8BF7\u624B\u52A8\u66F4\u65B0:",
|
|
4967
4971
|
updPeerDaemon: "peer \u7684\u7248\u672C\u5C5E\u4E8E\u6B63\u5728\u8FD0\u884C\u7684 agentnet daemon,\u4E0D\u5C5E\u4E8E\u672C\u5E94\u7528\u3002\u8BF7\u7528\u8FD9\u6761\u547D\u4EE4\u66F4\u65B0:",
|
package/package.json
CHANGED