-
Notifications
You must be signed in to change notification settings - Fork 68
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
Oauth updates #1642
base: develop
Are you sure you want to change the base?
Oauth updates #1642
Conversation
1c7bc51
to
1c40cb3
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.
Hey, I just wanted to say, nice going on this!! I know it was a beast to get working, but in the end the code doesn't seem too crazy!
I left a few comments, mostly stylistic things. I haven't actually tested the flow yet but I would love to!
@@ -527,3 +527,78 @@ void showInputDialog<T>({ | |||
}), | |||
); | |||
} | |||
|
|||
/// Shows a dialog which takes input and offers suggestions | |||
Future<String?> showBlockingInputDialog<T>({ |
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 seems pretty similar to showInputDialog
. Is there any way to combine these?
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.
showInputDialog
doesn't block, so it didn't work to display the dialog where you enter your username on your first oauth login. So I modified it to create showBlockingInputDialog
. So yea, they are pretty similar. I think showInputDialog
is used in one other place in the code, maybe we could make that one blocking also?
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.
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.
By blocking I mean showBlockingInputDialog
will wait for the user to click accept
before running the code that follows it. So you can await showBlockingInputDialog
and that doesn't work with showInputDialog
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.
I will investigate and see if I can parameterize showInputDialog
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.
Ahh ok I gotcha! In that case, I think it makes sense to transition showInputDialog
into a await
able method. Existing code that doesn't care to await
can just not do that and let it run in the background. Let me know what you think.
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.
Yea, I think that makes sense. I can do that
Co-authored-by: William <sirwilliamthefirst@users.noreply.github.com>
Co-authored-by: William <sirwilliamthefirst@users.noreply.github.com>
…ng on getting thunderapp.dev callback working
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.
Nice, the code looks good now! I will try to test if/when I get the chance. If everything is working for you and @hjiangsu, don't worry about waiting for me!
Sounds good, the changes look good to me after a quick review, and I've already tested a previous implementation of this! However, I'm going to hold off on merging this in until v0.20.0 is closer to release, or at least until Lemmy's API changes are more stable (at the moment, it looks like there's still a lot of major changes to the API that we'll need to support eventually). This way, we can re-test the implementation closer to the next major release! |
Oauth updates.
This PR depends on thunder-app/lemmy_api_client#28
This can be tested against the lemmy instance at hopandzip.com which I deployed with the lemmy:main