Skip to content

Commit

Permalink
fix: Fix flickering in UploadOngoingScreen
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisCAD committed Mar 6, 2025
1 parent d64338b commit 7629133
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,11 @@ fun UploadScreen(
}
)

@Composable
fun exit() {
if (hasPickedFiles) LaunchedEffect(navigateBackToPickFiles) { navigateBackToPickFiles() }
else LaunchedEffect(exitNewTransfer) { exitNewTransfer() }
}

when (val state = uploadState) {
null -> {
exit()
// Extracting the if/else below to a local composable function causes flickering, so leave it here.
if (hasPickedFiles) LaunchedEffect(navigateBackToPickFiles) { navigateBackToPickFiles() }
else LaunchedEffect(exitNewTransfer) { exitNewTransfer() }
NoUploadOngoingEmptyState()
}
is UploadState.Ongoing -> UploadOngoingScreen(
Expand Down

0 comments on commit 7629133

Please sign in to comment.