Skip to content

Commit

Permalink
browsersetting: don't send update if old value and new value is same
Browse files Browse the repository at this point in the history
Signed-off-by: Rashesh <rashesh.padia@collabora.com>
Change-Id: I89b64a7c014ec52898906b88829d08edda18894f
  • Loading branch information
Rash419 committed Feb 27, 2025
1 parent 6a4779d commit 4ee56ae
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion browser/js/global.js
Original file line number Diff line number Diff line change
Expand Up @@ -739,8 +739,9 @@ function getInitializerClass() {
set: function(key, value) {
value = String(value); // NOT "new String(...)". We cannot use .toString here because value could be null/undefined
if (global.prefs.useBrowserSetting) {
const oldValue = global.prefs._userBrowserSetting[key];
global.prefs._userBrowserSetting[key] = value;
if (global.socket && (global.socket instanceof WebSocket) && global.socket.readyState === 1)
if (global.socket && (global.socket instanceof WebSocket) && global.socket.readyState === 1 && oldValue !== value)
global.socket.send('browsersetting action=update key=' + key + ' value=' + value);
}
if (global.prefs.canPersist) {
Expand Down

0 comments on commit 4ee56ae

Please sign in to comment.