From d57b5ad6f74ba8cd590db20d7d3aa60947796b24 Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Fri, 1 Mar 2024 21:35:33 +0200 Subject: [PATCH] Fix code style --- public/script.js | 6 ++---- public/style.css | 3 +-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/public/script.js b/public/script.js index b47646585..cd3ea76d6 100644 --- a/public/script.js +++ b/public/script.js @@ -6206,10 +6206,8 @@ export async function displayPastChats() { // Fragment search a.k.a. swoop (as in `helm-swoop` in the Helm package of Emacs). // Split a `query` {string} into its fragments {string[]}. function makeQueryFragments(query) { - let fragments = query.trim().split(/\s+/).map( function (str) { return str.trim(); } ); - fragments = [...new Set(fragments)]; // uniques only + let fragments = query.trim().split(/\s+/).map(str => str.trim().toLowerCase()).filter(onlyUnique); // fragments = fragments.filter( function(str) { return str.length >= 3; } ); // Helm does this, but perhaps better if we don't. - fragments = fragments.map( function (str) { return str.toLowerCase(); } ); return fragments; } // Check whether `text` {string} includes all of the `fragments` {string[]}. @@ -6217,7 +6215,7 @@ export async function displayPastChats() { if (!text) { return false; } - return fragments.every(function (item, idx, arr) { return text.includes(item); }); + return fragments.every(item => text.includes(item)); } const fragments = makeQueryFragments(searchQuery); // At least one chat message must match *all* the fragments. diff --git a/public/style.css b/public/style.css index 21b929831..c8befaf63 100644 --- a/public/style.css +++ b/public/style.css @@ -275,8 +275,7 @@ table.responsiveTable { color: var(--SmartThemeEmColor); } -.mes_text u -{ +.mes_text u { color: var(--SmartThemeUnderlineColor); }