Skip to content

Commit

Permalink
Optimize ImportedFilesCard
Browse files Browse the repository at this point in the history
  • Loading branch information
LunarX committed Oct 18, 2024
1 parent 8262a8f commit fe29456
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ import androidx.compose.material3.ButtonDefaults
import androidx.compose.material3.Icon
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.derivedStateOf
import androidx.compose.runtime.getValue
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.pluralStringResource
import androidx.compose.ui.tooling.preview.Preview
Expand All @@ -53,7 +50,8 @@ fun ImportedFilesCard(
showUploadSourceChoiceBottomSheet: () -> Unit,
removeFileByUid: (uid: String) -> Unit,
) {
val fileCount by remember { derivedStateOf { files().count() } }
val importedFiles = files()
val fileCount = importedFiles.count()

SwissTransferCard(modifier) {
SharpRippleButton(onClick = { /*TODO*/ }) {
Expand Down Expand Up @@ -93,7 +91,7 @@ fun ImportedFilesCard(
}

items(
items = files().asReversed(),
items = importedFiles.asReversed(),
key = { TransferLazyRowKey(TransferLazyRowKey.Type.FILE, it.uid) },
) { file ->
SmallFileItem(
Expand Down

0 comments on commit fe29456

Please sign in to comment.