fix(settings): persist latencyPing settings through native host round-trip
CI / Build & Test (push) Successful in 2m54s
CI / Build & Test (push) Successful in 2m54s
Add latencyPingEnabled and latencyPingIntervalMs to the native host SETTINGS_DEFAULTS and updateSettings handler so they are persisted to state.json and returned in the save response. Previously these fields were extension-only and were silently dropped, causing the UI to revert to defaults after every save.
This commit is contained in:
@@ -42,6 +42,8 @@ function updateSettings(patch) {
|
|||||||
if (typeof patch.backupRetention === 'number') currentSettings.backupRetention = patch.backupRetention;
|
if (typeof patch.backupRetention === 'number') currentSettings.backupRetention = patch.backupRetention;
|
||||||
if (typeof patch.backupIntervalHours === 'number') currentSettings.backupIntervalHours = patch.backupIntervalHours;
|
if (typeof patch.backupIntervalHours === 'number') currentSettings.backupIntervalHours = patch.backupIntervalHours;
|
||||||
if (typeof patch.tunnelAutoReconnect === 'boolean') currentSettings.tunnelAutoReconnect = patch.tunnelAutoReconnect;
|
if (typeof patch.tunnelAutoReconnect === 'boolean') currentSettings.tunnelAutoReconnect = patch.tunnelAutoReconnect;
|
||||||
|
if (typeof patch.latencyPingEnabled === 'boolean') currentSettings.latencyPingEnabled = patch.latencyPingEnabled;
|
||||||
|
if (typeof patch.latencyPingIntervalMs === 'number' && patch.latencyPingIntervalMs > 0) currentSettings.latencyPingIntervalMs = patch.latencyPingIntervalMs;
|
||||||
if (_saveState) _saveState();
|
if (_saveState) _saveState();
|
||||||
return { requiresRestart };
|
return { requiresRestart };
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,9 @@ const SETTINGS_DEFAULTS = {
|
|||||||
disableOnFileUrls: false,
|
disableOnFileUrls: false,
|
||||||
backupRetention: 5,
|
backupRetention: 5,
|
||||||
backupIntervalHours: 0,
|
backupIntervalHours: 0,
|
||||||
tunnelAutoReconnect: false
|
tunnelAutoReconnect: false,
|
||||||
|
latencyPingEnabled: true,
|
||||||
|
latencyPingIntervalMs: 5000
|
||||||
};
|
};
|
||||||
|
|
||||||
const DEBUG = process.env.HOLESAIL_DEBUG === '1' || process.env.HOLESAIL_DEBUG === 'true';
|
const DEBUG = process.env.HOLESAIL_DEBUG === '1' || process.env.HOLESAIL_DEBUG === 'true';
|
||||||
|
|||||||
Reference in New Issue
Block a user