-
Notifications
You must be signed in to change notification settings - Fork 909
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create toast UI #5187
Create toast UI #5187
Conversation
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @CrisBarreiro and the rest of your teammates on Graphite |
c97b284
to
d7377d2
Compare
df513f9
to
9d2ea88
Compare
d7377d2
to
54fb184
Compare
9d2ea88
to
6540513
Compare
54fb184
to
d3c62f3
Compare
6284500
to
e57d6a0
Compare
d3c62f3
to
f4943ba
Compare
e57d6a0
to
b83bc3f
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.
|
||
suspend fun userAcceptedPrompt() | ||
|
||
fun isFeatureEnabled(): Boolean |
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.
The value of the toggle is stored in shared prefs, so this method is not safe to use from main thread - can we make it suspend fun
+ switch context to IO dispatcher for accessing the flag?
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.
it should be safe because we're accessing the cached value, not the shared prefs one
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.
That's true in case of subsequent invocations of this method - during the first call, cache is populated synchronously, so this method may block whichever thread is executing it. I'm not sure if you ever intend to execute this method from main thread - ideally, we shouldn't do any I/O operation on main thread if we can avoid it.
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.
Ah yes, you're right, this one doesn't come from DataStore!
@@ -45,6 +50,10 @@ interface BrokenSitePomptDataStore { | |||
|
|||
suspend fun setCoolDownDays(days: Int) | |||
fun getCoolDownDays(): Int | |||
suspend fun setDismissStreak(streak: Int) | |||
fun getDismissStreak(): Int | |||
suspend fun setNextShownDate(nextShownDate: LocalDate?) |
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.
Just to confirm if I understand the logic correctly, if the prompt has coolDownDays = 1, that doesn't mean "don't show the prompt for 24h after it was dismissed", it means "don't show the prompt until the next calendar day after it was dismissed" ?
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.
At this point, it does, but a subsequent PR already migrates to the 24h approach
f4943ba
to
6a2eb12
Compare
2162998
to
fee4c7f
Compare
dcef84e
to
a4f12cf
Compare
fee4c7f
to
c91ebca
Compare
c91ebca
into
feature/cris/broken-site/base
Task/Issue URL: https://app.asana.com/0/1204920898013511/1208572901396840/f
Description
Steps to test this PR
Feature 1
UI changes