Skip to content

Commit

Permalink
fix(ui): quick download not working
Browse files Browse the repository at this point in the history
  • Loading branch information
JunkFood02 committed Nov 9, 2023
1 parent d0d53b8 commit 633718a
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions app/src/main/java/com/junkfood/seal/QuickDownloadActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@ import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.appcompat.app.AppCompatDelegate
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.SheetValue
import androidx.compose.material3.rememberModalBottomSheetState
import androidx.compose.material3.windowsizeclass.ExperimentalMaterial3WindowSizeClassApi
import androidx.compose.material3.windowsizeclass.WindowWidthSizeClass
import androidx.compose.material3.windowsizeclass.calculateWindowSizeClass
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
Expand Down Expand Up @@ -128,14 +126,10 @@ class QuickDownloadActivity : ComponentActivity() {
var showDialog by remember { mutableStateOf(true) }
val sheetState =
rememberModalBottomSheetState(skipPartiallyExpanded = true)

LaunchedEffect(sheetState.currentValue, showDialog) {
if (sheetState.currentValue == SheetValue.Hidden || !showDialog)
this@QuickDownloadActivity.finish()
}

val useDialog = LocalWindowWidthState.current != WindowWidthSizeClass.Compact
DownloadSettingDialog(
useDialog = LocalWindowWidthState.current != WindowWidthSizeClass.Compact,
useDialog = useDialog,
showDialog = showDialog,
isQuickDownload = true,
sheetState = sheetState,
Expand All @@ -150,6 +144,7 @@ class QuickDownloadActivity : ComponentActivity() {
} else {
showDialog = false
}
this@QuickDownloadActivity.finish()
},
)
}
Expand Down

0 comments on commit 633718a

Please sign in to comment.