From 846418b63bc3d50738d8ea7067e1637bffd74bfb Mon Sep 17 00:00:00 2001 From: SergeantPanda Date: Fri, 11 Jul 2025 17:14:44 -0500 Subject: [PATCH] Refactor settings save logic to remove unnecessary rehash execution --- frontend/src/pages/Settings.jsx | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/frontend/src/pages/Settings.jsx b/frontend/src/pages/Settings.jsx index 323a4e49..1518d91c 100644 --- a/frontend/src/pages/Settings.jsx +++ b/frontend/src/pages/Settings.jsx @@ -164,12 +164,12 @@ const SettingsPage = () => { const values = form.getValues(); const changedSettings = {}; let m3uHashKeyChanged = false; - + for (const settingKey in values) { // If the user changed the setting's value from what's in the DB: if (String(values[settingKey]) !== String(settings[settingKey].value)) { changedSettings[settingKey] = `${values[settingKey]}`; - + // Check if M3U hash key was changed if (settingKey === 'm3u-hash-key') { m3uHashKeyChanged = true; @@ -292,11 +292,11 @@ const SettingsPage = () => { const executeSettingsSaveAndRehash = async () => { setRehashConfirmOpen(false); - + // First save the settings const values = form.getValues(); const changedSettings = {}; - + for (const settingKey in values) { if (String(values[settingKey]) !== String(settings[settingKey].value)) { changedSettings[settingKey] = `${values[settingKey]}`; @@ -310,9 +310,6 @@ const SettingsPage = () => { value: changedSettings[updatedKey], }); } - - // Then execute the rehash - await executeRehashStreams(); }; return (