-
Notifications
You must be signed in to change notification settings - Fork 1.3k
For #8565: Fix updating dropdown preferences in ETP settings! #8573
Conversation
@@ -0,0 +1,20 @@ | |||
package org.mozilla.fenix.settings |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit - license
|
||
fun DropDownListPreference.findEntriesValue(newValue: Any?): CharSequence? { | ||
val newValueString = newValue as? String ?: return null | ||
val index = this.findIndexOfValue(newValueString) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So why when we get the EntriesValue do we have to find the index of value of this valueString and then return the entry based on the index? What is the newValueString
then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have two arrays that store entries and entries values. Previously we received social
for example, but we needed Cross-site and social media trackers
, otherwise the preference would not have updated.
Codecov Report
@@ Coverage Diff @@
## master #8573 +/- ##
============================================
+ Coverage 18.62% 18.66% +0.04%
Complexity 464 464
============================================
Files 319 320 +1
Lines 12737 12747 +10
Branches 1682 1683 +1
============================================
+ Hits 2372 2379 +7
- Misses 10163 10165 +2
- Partials 202 203 +1
Continue to review full report at Codecov.
|
5668ee1
to
55c5cf2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good 😄
Pull Request checklist
After merge
To download an APK when reviewing a PR: