Skip to content

Commit

Permalink
fix: MediainfoDialog proper state handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Vodes committed Mar 24, 2024
1 parent 9517d19 commit 07c8359
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package moe.styx.common.compose.components.anime
import androidx.compose.foundation.layout.*
import androidx.compose.material3.*
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
Expand All @@ -11,6 +12,7 @@ import moe.styx.common.compose.components.AppShapes
import moe.styx.common.compose.components.misc.OutlinedText
import moe.styx.common.compose.components.misc.TextWithCheckBox
import moe.styx.common.compose.files.Storage
import moe.styx.common.compose.files.collectWithEmptyInitial
import moe.styx.common.data.MediaEntry
import moe.styx.common.extension.eqI
import moe.styx.common.extension.toBoolean
Expand All @@ -34,7 +36,8 @@ fun FailedDialog(message: String, modifier: Modifier = Modifier, buttonModifier:
@OptIn(ExperimentalMaterial3Api::class, ExperimentalLayoutApi::class)
@Composable
fun MediaInfoDialog(mediaEntry: MediaEntry, onDismiss: () -> Unit) {
val mediaInfo = Storage.mediaInfos.find { it.entryID eqI mediaEntry.GUID }
val mediaInfos by Storage.stores.mediainfoStore.collectWithEmptyInitial()
val mediaInfo = mediaInfos.find { it.entryID eqI mediaEntry.GUID }
BasicAlertDialog(onDismiss, properties = DialogProperties(usePlatformDefaultWidth = false)) {
Surface(color = MaterialTheme.colorScheme.surface, shape = AppShapes.medium) {
Column(Modifier.padding(10.dp)) {
Expand Down

0 comments on commit 07c8359

Please sign in to comment.