@decentnetwork/lan 0.1.231 → 0.1.233
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/ui/desktop/app.js +12 -7
- package/package.json +1 -1
package/dist/ui/desktop/app.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
window.__DK_UI_VERSION="0.1.233";
|
|
1
2
|
const ICON_PATHS = {
|
|
2
3
|
// ---- tab bar (the four must feel like one set) ----
|
|
3
4
|
users: '<path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"/><circle cx="9" cy="7" r="4"/><path d="M22 21v-2a4 4 0 0 0-3-3.87"/><path d="M16 3.13a4 4 0 0 1 0 7.75"/>',
|
|
@@ -2912,6 +2913,15 @@ function DkApp() {
|
|
|
2912
2913
|
const [activeId, setActiveId] = React.useState(null);
|
|
2913
2914
|
const data = useDaemonData();
|
|
2914
2915
|
const me = data.me;
|
|
2916
|
+
React.useEffect(() => {
|
|
2917
|
+
const mine = window.__DK_UI_VERSION;
|
|
2918
|
+
const served = me && me.lanVer;
|
|
2919
|
+
if (!mine || !served || mine === served) return;
|
|
2920
|
+
const key = "dk-reloaded-for-" + served;
|
|
2921
|
+
if (sessionStorage.getItem(key)) return;
|
|
2922
|
+
sessionStorage.setItem(key, "1");
|
|
2923
|
+
window.location.reload();
|
|
2924
|
+
}, [me && me.lanVer]);
|
|
2915
2925
|
const peers = data.peers;
|
|
2916
2926
|
const requests = data.requests;
|
|
2917
2927
|
const exits = data.exits;
|
|
@@ -2972,14 +2982,9 @@ function DkApp() {
|
|
|
2972
2982
|
if (!activeId || !text || !text.trim()) return;
|
|
2973
2983
|
dkApi.send(activeId, text.trim()).then(() => data.loadThread(activeId)).then(data.refresh);
|
|
2974
2984
|
};
|
|
2975
|
-
const onSendFile = (file
|
|
2985
|
+
const onSendFile = (file) => {
|
|
2976
2986
|
if (!activeId || !file) return Promise.resolve({ ok: false });
|
|
2977
|
-
return
|
|
2978
|
-
if (r && r.ok && r.via === "webrtc") {
|
|
2979
|
-
return dkApi.send(activeId, (t.lang === "zh" ? "\u5DF2\u901A\u8FC7 WebRTC \u53D1\u9001\u6587\u4EF6: " : "sent file via WebRTC: ") + file.name).then(() => ({ ok: true, via: "webrtc" }));
|
|
2980
|
-
}
|
|
2981
|
-
return dkApi.sendFile(activeId, file);
|
|
2982
|
-
}).then((r) => {
|
|
2987
|
+
return dkApi.sendFile(activeId, file).then((r) => {
|
|
2983
2988
|
data.loadThread(activeId);
|
|
2984
2989
|
data.refresh();
|
|
2985
2990
|
return r;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@decentnetwork/lan",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.233",
|
|
4
4
|
"description": "Private virtual LAN for self-hosted services and AI agents, built on Elastos Carrier. NAT-traversal, name service, ACL, all over a peer-to-peer mesh — no public IP required.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|