Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ fun EditScreenScaffoldWithAppBar(
},
actions = {
AboutButton { onAboutPressed() }
if (couldRequestFullSpace()) {
if (uiState.xrEnabled && couldRequestFullSpace()) {
RequestFullSpaceIconButton()
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,13 @@ fun ResultsScreenContents(
},
actions = {
AboutButton { onAboutPress() }
if (couldRequestFullSpace()) {
RequestFullSpaceIconButton()
}
if (couldRequestHomeSpace()) {
RequestHomeSpaceIconButton()
if (state.xrEnabled) {
if (couldRequestFullSpace()) {
RequestFullSpaceIconButton()
}
if (couldRequestHomeSpace()) {
RequestHomeSpaceIconButton()
}
}
Comment on lines +141 to 148
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

While this is functionally correct, it introduces an extra level of nesting. For consistency with the changes in EditScreen.kt, you could combine the state.xrEnabled check into each of the inner if statements. This would flatten the structure and make the coding style more uniform across the codebase.

For example:

if (state.xrEnabled && couldRequestFullSpace()) {
    RequestFullSpaceIconButton()
}
if (state.xrEnabled && couldRequestHomeSpace()) {
    RequestHomeSpaceIconButton()
}

},
)
Expand Down