Repository navigation
Fix main: sign-in dialog placement and missing state collection #37
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -117,6 +117,7 @@ import java.util.Locale | |
| fun BrowserApp(viewModel: BrowserViewModel) { | ||
| val context = LocalContext.current | ||
| val settings by viewModel.settings.collectAsStateWithLifecycle() | ||
| val signInError by viewModel.signInError.collectAsStateWithLifecycle() | ||
| val accountState by viewModel.accountState.collectAsStateWithLifecycle() | ||
| val tabs by viewModel.tabs.collectAsStateWithLifecycle() | ||
| val activeTab by viewModel.activeTab.collectAsStateWithLifecycle() | ||
|
|
@@ -793,6 +794,24 @@ fun BrowserApp(viewModel: BrowserViewModel) { | |
| ) | ||
| } | ||
|
|
||
| signInError?.let { detail -> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sign-in failures never set the dialog state. The dialog in Declare the state in
|
||
| AlertDialog( | ||
| onDismissRequest = { viewModel.dismissSignInError() }, | ||
| title = { Text("Bansify sign-in failed") }, | ||
| text = { | ||
| Text( | ||
| detail + "\n\nApp " + com.bansify.browser.BuildConfig.VERSION_NAME | ||
| ) | ||
| }, | ||
| confirmButton = { | ||
| TextButton(onClick = { viewModel.dismissSignInError() }) { | ||
| Text("Close") | ||
| } | ||
| } | ||
| ) | ||
| } | ||
|
|
||
|
|
||
| // Root-aligned Chrome 3-Dot Floating Overflow Menu | ||
| ChromeOverflowMenu( | ||
| expanded = overflowMenuExpanded, | ||
|
|
||
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.
Add the missing view-model API.
BrowserViewModeldefines neithersignInErrornordismissSignInError(). The app therefore still fails to compile, so this change does not fix the Quality Gate failure. Add both members in the same change.