adhdev 0.6.70 → 0.6.71
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/cli/index.js +12 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/index.js +12 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -40941,7 +40941,7 @@ var init_adhdev_daemon = __esm({
|
|
|
40941
40941
|
fs12 = __toESM(require("fs"));
|
|
40942
40942
|
path14 = __toESM(require("path"));
|
|
40943
40943
|
import_chalk2 = __toESM(require("chalk"));
|
|
40944
|
-
pkgVersion = "0.6.
|
|
40944
|
+
pkgVersion = "0.6.71";
|
|
40945
40945
|
if (pkgVersion === "unknown") {
|
|
40946
40946
|
try {
|
|
40947
40947
|
const possiblePaths = [
|
|
@@ -41128,6 +41128,17 @@ ${err?.stack || ""}`);
|
|
|
41128
41128
|
console.log(import_chalk2.default.gray(" \u26A0 P2P unavailable \u2014 using server relay"));
|
|
41129
41129
|
}
|
|
41130
41130
|
this.registerServerHandlers();
|
|
41131
|
+
this.serverConn.on("auth_ok", (msg) => {
|
|
41132
|
+
const serverNickname = msg.payload?.machineNickname;
|
|
41133
|
+
if (serverNickname === void 0) return;
|
|
41134
|
+
const nextNickname = typeof serverNickname === "string" && serverNickname.trim() ? serverNickname.trim() : null;
|
|
41135
|
+
const latestConfig = loadConfig();
|
|
41136
|
+
if ((latestConfig.machineNickname || null) === nextNickname) return;
|
|
41137
|
+
latestConfig.machineNickname = nextNickname;
|
|
41138
|
+
saveConfig(latestConfig);
|
|
41139
|
+
LOG.info("Server", `[ServerConn] Synced machine nickname from server: ${nextNickname || "(cleared)"}`);
|
|
41140
|
+
this.statusReporter?.throttledReport();
|
|
41141
|
+
});
|
|
41131
41142
|
this.serverConn.onStateChange((state) => {
|
|
41132
41143
|
if (state === "connected") {
|
|
41133
41144
|
console.log(import_chalk2.default.green(" \u{1F4E1} Connected to ADHDev server"));
|