No ned to add/remove chips locally in KeywordPreference.
This commit is contained in:
parent
1127a05a3e
commit
dbc76c7aee
|
@ -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()
|
||||
|
|
|
@ -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))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue