Skip to content

Commit 08cd16f

Browse files
authored
Merge pull request #764 from ceotjoe/hotfix/settings-sync-path-undefined-clean
fix: SETTINGS_SYNC crash and black screen on HTTP/LAN access
2 parents 4594a62 + e4811e8 commit 08cd16f

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

server/routes/config-routes.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*/
55

66
const fs = require('fs');
7+
const path = require('path');
78

89
module.exports = function (app, ctx) {
910
const {

src/components/MeshtasticPanel.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ function getMeshSessionId() {
1818
id = localStorage.getItem(key);
1919
} catch {}
2020
if (id && /^[a-zA-Z0-9_-]{8,64}$/.test(id)) return id;
21-
id = crypto.randomUUID().replace(/-/g, '').slice(0, 32);
21+
id =
22+
typeof crypto.randomUUID === 'function'
23+
? crypto.randomUUID().replace(/-/g, '').slice(0, 32)
24+
: Array.from({ length: 32 }, () => Math.floor(Math.random() * 16).toString(16)).join('');
2225
try {
2326
localStorage.setItem(key, id);
2427
} catch {}

0 commit comments

Comments
 (0)