mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
feat: case-insensitive search (#347)
This commit is contained in:
@ -396,7 +396,7 @@ const MemoEditor: React.FC = () => {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="btns-container">
|
<div className="btns-container">
|
||||||
<button className="action-btn confirm-btn" disabled={!allowSave} onClick={handleSaveBtnClick}>
|
<button className="action-btn confirm-btn" disabled={!allowSave || state.isUploadingResource} onClick={handleSaveBtnClick}>
|
||||||
{t("editor.save")}
|
{t("editor.save")}
|
||||||
<img className="icon-img" src="/logo.webp" />
|
<img className="icon-img" src="/logo.webp" />
|
||||||
</button>
|
</button>
|
||||||
|
@ -32,7 +32,6 @@ const MemoList = () => {
|
|||||||
shouldShow = checkShouldShowMemoWithFilters(memo, filters);
|
shouldShow = checkShouldShowMemoWithFilters(memo, filters);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tagQuery) {
|
if (tagQuery) {
|
||||||
const tagsSet = new Set<string>();
|
const tagsSet = new Set<string>();
|
||||||
for (const t of Array.from(memo.content.match(new RegExp(TAG_REG, "g")) ?? [])) {
|
for (const t of Array.from(memo.content.match(new RegExp(TAG_REG, "g")) ?? [])) {
|
||||||
@ -63,7 +62,7 @@ const MemoList = () => {
|
|||||||
shouldShow = false;
|
shouldShow = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (textQuery && !memo.content.includes(textQuery)) {
|
if (textQuery && !memo.content.toLowerCase().includes(textQuery.toLowerCase())) {
|
||||||
shouldShow = false;
|
shouldShow = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -142,7 +142,7 @@ export const checkShouldShowMemo = (memo: Memo, filter: Filter) => {
|
|||||||
}
|
}
|
||||||
shouldShow = matched;
|
shouldShow = matched;
|
||||||
} else if (type === "TEXT") {
|
} else if (type === "TEXT") {
|
||||||
let contained = memo.content.includes(value);
|
let contained = memo.content.toLowerCase().includes(value.toLowerCase());
|
||||||
if (operator === "NOT_CONTAIN") {
|
if (operator === "NOT_CONTAIN") {
|
||||||
contained = !contained;
|
contained = !contained;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user