fix(ComponentPicker): version list not updating when changed

This commit is contained in:
rushiiMachine 2025-01-11 14:00:21 -08:00
parent 441a84ef66
commit 52bb101f16
No known key found for this signature in database
GPG key ID: DCBE5952BB3B6420
3 changed files with 6 additions and 3 deletions

View file

@ -2,6 +2,7 @@ package com.aliucord.manager.patcher.steps.download
import android.util.Log
import androidx.compose.runtime.Stable
import androidx.compose.runtime.mutableStateListOf
import com.aliucord.manager.BuildConfig
import com.aliucord.manager.R
import com.aliucord.manager.manager.OverlayManager
@ -37,7 +38,7 @@ class DownloadInjectorStep : DownloadStep(), IDexProvider, KoinComponent {
get() = paths.cachedInjectorDex(targetVersion, custom = isCustomVersion)
override suspend fun execute(container: StepRunner) {
var customVersions = mutableListOf<SemVer>()
var customVersions = mutableStateListOf<SemVer>()
.apply { addAll(paths.customInjectorDexs()) }
// Prompt to select or manage custom versions instead of downloading

View file

@ -2,6 +2,7 @@ package com.aliucord.manager.patcher.steps.download
import android.util.Log
import androidx.compose.runtime.Stable
import androidx.compose.runtime.mutableStateListOf
import com.aliucord.manager.BuildConfig
import com.aliucord.manager.R
import com.aliucord.manager.manager.OverlayManager
@ -35,7 +36,7 @@ class DownloadPatchesStep : DownloadStep(), KoinComponent {
override val targetFile get() = paths.cachedSmaliPatches(targetVersion, isCustomVersion)
override suspend fun execute(container: StepRunner) {
var customVersions = mutableListOf<SemVer>()
var customVersions = mutableStateListOf<SemVer>()
.apply { addAll(paths.customSmaliPatches()) }
// Prompt to select or manage custom versions instead of downloading

View file

@ -5,6 +5,7 @@ import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.layout.*
import androidx.compose.material3.*
import androidx.compose.runtime.*
import androidx.compose.runtime.snapshots.SnapshotStateList
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.painterResource
@ -19,7 +20,7 @@ import com.aliucord.manager.network.utils.SemVer
@Composable
fun CustomComponentVersionPicker(
componentTitle: String,
versions: List<SemVer>,
versions: SnapshotStateList<SemVer>,
onConfirm: (SemVer) -> Unit,
onDelete: (SemVer) -> Unit,
onCancel: () -> Unit,