Skip to content

Commit

Permalink
chore: Fix rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
tevincent committed Nov 26, 2024
1 parent b4b33cf commit 3ce7ee0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ fun TransferDetailsScreen(
navigateBack?.invoke()
} else if (!isLoading) {
TransferDetailsScreen(
transferDetailsViewModel,
transferUuid,
transferUrl = transferDetailsViewModel.getTransferUrl(transferUuid),
direction = direction,
navigateBack = navigateBack,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,6 @@ class TransferDetailsViewModel @Inject constructor(

fun getTransferUrl(transferUuid: String): String = sharedApiUrlCreator.shareTransferUrl(transferUuid)

fun removeTransfer(transferUuid: String) {
viewModelScope.launch {
transferManager.removeTransfer(transferUuid)
}
}

sealed class TransferDetailsUiState {

@Immutable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ import com.infomaniak.swisstransfer.ui.theme.SwissTransferTheme
import com.infomaniak.swisstransfer.ui.utils.PreviewLightAndDark

@Composable
fun TransferInfo(transfer: () -> TransferUi) {
fun TransferInfo(getTransfer: () -> TransferUi) {

val filesCount by remember { derivedStateOf { transfer().files.count() } }
val downloadedCount by remember { derivedStateOf { transfer().downloadLimit - transfer().downloadLeft } }
val filesCount by remember { derivedStateOf { getTransfer().files.count() } }
val downloadedCount by remember { derivedStateOf { getTransfer().downloadLimit - getTransfer().downloadLeft } }

Row(verticalAlignment = Alignment.CenterVertically) {
Icon(
Expand All @@ -62,7 +62,7 @@ fun TransferInfo(transfer: () -> TransferUi) {
Spacer(Modifier.width(Margin.Mini))
TextDotText(
firstText = { pluralStringResource(R.plurals.filesCount, filesCount, filesCount) },
secondText = { Formatter.formatShortFileSize(LocalContext.current, transfer().sizeUploaded) },
secondText = { Formatter.formatShortFileSize(LocalContext.current, getTransfer().sizeUploaded) },
color = SwissTransferTheme.colors.primaryTextColor,
)
}
Expand All @@ -71,14 +71,14 @@ fun TransferInfo(transfer: () -> TransferUi) {

IconText(
icon = AppIcons.Clock,
text = stringResource(R.string.expiresIn, transfer().expiresInDays),
text = stringResource(R.string.expiresIn, getTransfer().expiresInDays),
)

HorizontalDivider(modifier = Modifier.padding(vertical = Margin.Medium))

IconText(
icon = AppIcons.ArrowDownFile,
text = stringResource(R.string.downloadedTransferLabel, downloadedCount, transfer().downloadLimit),
text = stringResource(R.string.downloadedTransferLabel, downloadedCount, getTransfer().downloadLimit),
)
}

Expand Down

0 comments on commit 3ce7ee0

Please sign in to comment.