cleanup, simplify, and merge duplicate word mute implementations
This commit is contained in:
parent
b52db71e18
commit
8348a36f24
6 changed files with 44 additions and 72 deletions
|
|
@ -12,7 +12,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
<template #caption>{{ i18n.ts.wordMuteTestDescription }}</template>
|
||||
</MkTextarea>
|
||||
<div><MkButton :disabled="!testWords" @click="testWordMutes">{{ i18n.ts.wordMuteTestTest }}</MkButton></div>
|
||||
<div v-if="testMatches == null">{{ i18n.ts.wordMuteTestNoResults}}</div>
|
||||
<div v-if="testMatches == null">{{ i18n.ts.wordMuteTestNoResults }}</div>
|
||||
<div v-else-if="testMatches === ''">{{ i18n.ts.wordMuteTestNoMatch }}</div>
|
||||
<div v-else>{{ i18n.tsx.wordMuteTestMatch({ words: testMatches }) }}</div>
|
||||
</div>
|
||||
|
|
@ -44,7 +44,7 @@ function testWordMutes() {
|
|||
try {
|
||||
const mutes = parseMutes(props.mutedWords);
|
||||
const matches = checkWordMute(testWords.value, null, mutes);
|
||||
testMatches.value = matches ? matches.flat(2).join(', ') : '';
|
||||
testMatches.value = matches ? matches.join(', ') : '';
|
||||
} catch {
|
||||
// Error is displayed by above function
|
||||
testMatches.value = null;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue