Add Lemmy Donation Dialog#1813
Conversation
…ast time it was shown, bumped version of lemmy-api
…g issue, removed changelogShown logic
MV-GH
left a comment
There was a problem hiding this comment.
How does this work with changelog dialog? Does it stack on top of each other?
Looks otherwise good to me.
| ) { | ||
| if (API.getInstanceOrNull()?.FF?.markDonationDialogShown() == true) { | ||
| scope.launch { | ||
| val result = API.getInstance().markDonationDialogShown() |
There was a problem hiding this comment.
Can't chain it because I'm using the feature flags on l146, I refactored it with an api variable instead
… when they show up to avoid conflicts
|
The changelog would conflict a bit with the donation dialog if both should be shown, I made a combined app startup dialogs component that manages the order they should be shown |
| } | ||
|
|
||
| // Determine which dialog to show | ||
| LaunchedEffect(changelogNeedsToShow, donationNeedsToShow) { |
There was a problem hiding this comment.
Whats the reason for this launched affect here?
There was a problem hiding this comment.
It works like you mentioned in the later comment, and I also made it to check activeDialog for null. This is because changelog changing to shouldShow = true for example would override the donation dialog currently showing. Now it waits until the current dialog is closed and then it changes the activeDialog.
There was a problem hiding this comment.
But I don't see why its needed?
Couldn't you get the exact same result by just removing the effect?
There was a problem hiding this comment.
I can imagine a scenario where the dialog has closed and activeDialog is null again, but the shouldShow logic for one of the dialogs hasn't received updated data yet for the condition to change, making the dialog open up again a second time
…ded up showing first
dessalines
left a comment
There was a problem hiding this comment.
Looks good to me.
The only potential change I can think of, is to prepend the donation dialog text to the changelog when both need to be shown, but that's up to you.
MV-GH
left a comment
There was a problem hiding this comment.
It's okay for me, just haven't tested it
dessalines
left a comment
There was a problem hiding this comment.
Just tested this out, and it works well. Thx!
Fixes #1794
Added a Donation Dialog in MainActivity which shows the donation message in case the user:
The dialog has a
Donatebutton, aNo Thanksbutton and the ability to dismiss it by clicking outside.If the user clicks
Donatethey get navigated to the donation page, and in all of the cases a POST request is then sent to thedonation_dialog_shownendpoint to update that the user has seen it, then the dialog closes.Also bumped the
lemmy-apiversion to 0.4.1.