From dbc76c7aee98fb6c473ac739b95a7d716a896f4f Mon Sep 17 00:00:00 2001 From: David Langley Date: Fri, 27 Aug 2021 11:52:00 +0100 Subject: [PATCH] No ned to add/remove chips locally in KeywordPreference. --- .../java/im/vector/app/core/preference/KeywordPreference.kt | 2 -- ...ettingsKeywordAndMentionsNotificationPreferenceFragment.kt | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/vector/src/main/java/im/vector/app/core/preference/KeywordPreference.kt b/vector/src/main/java/im/vector/app/core/preference/KeywordPreference.kt index 37d9a598e7..c70b403550 100644 --- a/vector/src/main/java/im/vector/app/core/preference/KeywordPreference.kt +++ b/vector/src/main/java/im/vector/app/core/preference/KeywordPreference.kt @@ -94,7 +94,6 @@ class KeywordPreference : VectorPreference { if (keyword.isEmpty()) { return false } - _keywords.add(keyword) listener?.didAddKeyword(keyword) onPreferenceChangeListener?.onPreferenceChange(this, _keywords) notifyChanged() @@ -123,7 +122,6 @@ class KeywordPreference : VectorPreference { if (!keywordsEnabled) { return@setOnCloseIconClickListener } - _keywords.remove(keyword) listener?.didRemoveKeyword(keyword) onPreferenceChangeListener?.onPreferenceChange(this, _keywords) notifyChanged() diff --git a/vector/src/main/java/im/vector/app/features/settings/notifications/VectorSettingsKeywordAndMentionsNotificationPreferenceFragment.kt b/vector/src/main/java/im/vector/app/features/settings/notifications/VectorSettingsKeywordAndMentionsNotificationPreferenceFragment.kt index 82663ae910..dd412742ca 100644 --- a/vector/src/main/java/im/vector/app/features/settings/notifications/VectorSettingsKeywordAndMentionsNotificationPreferenceFragment.kt +++ b/vector/src/main/java/im/vector/app/features/settings/notifications/VectorSettingsKeywordAndMentionsNotificationPreferenceFragment.kt @@ -148,7 +148,7 @@ class VectorSettingsKeywordAndMentionsNotificationPreferenceFragment hideLoadingView() // Already added to UI, no-op on success result.onFailure { - // Just display an error on failure, keywords will update when push rules refreshed + // Just display an error on failure, keywords have not been added to the UI activity?.toast(errorFormatter.toHumanReadable(it)) } } @@ -166,7 +166,7 @@ class VectorSettingsKeywordAndMentionsNotificationPreferenceFragment hideLoadingView() // Already added to UI, no-op on success result.onFailure { - // Just display an error on failure, keywords will update when push rules refreshed + // Just display an error on failure, keywords have not been added to the UI activity?.toast(errorFormatter.toHumanReadable(it)) } }