No ned to add/remove chips locally in KeywordPreference.

This commit is contained in:
David Langley 2021-08-27 11:52:00 +01:00
parent 1127a05a3e
commit dbc76c7aee
2 changed files with 2 additions and 4 deletions

View File

@ -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()

View File

@ -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))
}
}