From 7b1805274b7a77886e5e36a889722f0124a005ce Mon Sep 17 00:00:00 2001 From: sorairo Date: Sat, 4 Nov 2023 07:40:53 +0900 Subject: [PATCH] fix word mute --- lib/repository/account_repository.dart | 1 + lib/repository/note_repository.dart | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/repository/account_repository.dart b/lib/repository/account_repository.dart index e7f430152..6a8168bca 100644 --- a/lib/repository/account_repository.dart +++ b/lib/repository/account_repository.dart @@ -64,6 +64,7 @@ class AccountRepository extends ChangeNotifier { _account[index] = _account[index].copyWith(i: i); accountDataValidated[index] = true; + reader(notesProvider(_account[index])).updateMute(i.mutedWords); notifyListeners(); } diff --git a/lib/repository/note_repository.dart b/lib/repository/note_repository.dart index 1d58c802d..9c267fea7 100644 --- a/lib/repository/note_repository.dart +++ b/lib/repository/note_repository.dart @@ -26,7 +26,11 @@ class NoteRepository extends ChangeNotifier { final List muteWordRegExps = []; NoteRepository(this.misskey, Account account) { - for (final muteWord in account.i.mutedWords) { + updateMute(account.i.mutedWords); + } + + void updateMute(List mutedWords) { + for (final muteWord in mutedWords) { final content = muteWord.content; final regExp = muteWord.regExp; if (content != null) {