From 205a8bbbc58f44921c63b6cf85d38ced1f32bb65 Mon Sep 17 00:00:00 2001 From: jelveh Date: Fri, 24 Apr 2026 22:36:31 -0700 Subject: [PATCH] Replace lodash _.replace and _.pullAll usage --- src/gui/src/UI/UIDesktop.js | 4 ++-- src/gui/src/UI/UIWindow.js | 2 +- src/gui/src/helpers.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/src/UI/UIDesktop.js b/src/gui/src/UI/UIDesktop.js index b6a3f0d8e..59819424c 100644 --- a/src/gui/src/UI/UIDesktop.js +++ b/src/gui/src/UI/UIDesktop.js @@ -384,7 +384,7 @@ async function UIDesktop (options) { // Update all elements whose paths start with old_path $(`[data-path^="${`${html_encode(item.old_path) }/`}"]`).each(function () { - const new_el_path = _.replace($(this).attr('data-path'), `${item.old_path }/`, `${new_path }/`); + const new_el_path = $(this).attr('data-path').replace(`${item.old_path }/`, `${new_path }/`); $(this).attr('data-path', new_el_path); }); @@ -599,7 +599,7 @@ async function UIDesktop (options) { // Update all elements whose paths start with old_path $(`[data-path^="${`${html_encode(item.old_path) }/`}"]`).each(function () { - const new_el_path = _.replace($(this).attr('data-path'), `${item.old_path }/`, `${new_path }/`); + const new_el_path = $(this).attr('data-path').replace(`${item.old_path }/`, `${new_path }/`); $(this).attr('data-path', new_el_path); }); diff --git a/src/gui/src/UI/UIWindow.js b/src/gui/src/UI/UIWindow.js index 44c05d045..06b45fbaf 100644 --- a/src/gui/src/UI/UIWindow.js +++ b/src/gui/src/UI/UIWindow.js @@ -3674,7 +3674,7 @@ $.fn.close = async function (options) { const win_id = parseInt($(this).attr('data-id')); let window_uuid = $(this).attr('data-element_uuid'); // remove all instances of win_id from window.window_stack - _.pullAll(window.window_stack, [win_id]); + window.window_stack = window.window_stack.filter(id => id !== win_id); // taskbar update let open_window_count = parseInt($(`.taskbar-item[data-app="${$(this).attr('data-app')}"]`).attr('data-open-windows')); // update open window count of corresponding taskbar item diff --git a/src/gui/src/helpers.js b/src/gui/src/helpers.js index ac15a5a4d..3e30602be 100644 --- a/src/gui/src/helpers.js +++ b/src/gui/src/helpers.js @@ -2923,7 +2923,7 @@ window.rename_file = async (options, new_name, old_name, old_path, el_item, el_i // Update the paths of all elements whose paths start with `old_path` $(`[data-path^="${`${html_encode(old_path) }/`}"]`).each(function () { - const new_el_path = _.replace($(this).attr('data-path'), `${old_path }/`, `${new_path}/`); + const new_el_path = $(this).attr('data-path').replace(`${old_path }/`, `${new_path}/`); $(this).attr('data-path', new_el_path); });