Skip to content

A platform for community discussion. Free, open, simple.

DEV: Replace `without` usage and update deprecation handling (#34971)

Sérgio Saquetim8624dabc4bcf
diff --git a/app/assets/javascripts/discourse/app/deprecation-workflow.js b/app/assets/javascripts/discourse/app/deprecation-workflow.js
index 35b4afd8f49..586afeb6f37 100644
--- a/app/assets/javascripts/discourse/app/deprecation-workflow.js
+++ b/app/assets/javascripts/discourse/app/deprecation-workflow.js
@@ -258,6 +258,10 @@ const DeprecationWorkflow = new DiscourseDeprecationWorkflow([
handler: "log",
matchId: "discourse.native-array-extensions.findBy",
},
+ {
+ handler: "log",
+ matchId: "discourse.native-array-extensions.without",
+ },
{
handler: ["silence", "counter"],
matchId: /^discourse\.native-array-extensions\..+$/,
diff --git a/app/assets/javascripts/discourse/app/lib/search.js b/app/assets/javascripts/discourse/app/lib/search.js
index 4aa02695bbe..64da8531ec2 100644
--- a/app/assets/javascripts/discourse/app/lib/search.js
+++ b/app/assets/javascripts/discourse/app/lib/search.js
@@ -272,7 +272,7 @@ export function updateRecentSearches(currentUser, term) {
let recentSearches = Object.assign(currentUser.recent_searches || []);
if (recentSearches.includes(term)) {
- recentSearches = recentSearches.without(term);
+ recentSearches = recentSearches.filter((item) => item !== term);
} else if (recentSearches.length === MAX_RECENT_SEARCHES) {
recentSearches.popObject();
}