Skip to content

Commit

Permalink
refactor: Clean code
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinBoulongne committed Dec 19, 2024
1 parent 6003dc0 commit aa29634
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*/
package com.infomaniak.swisstransfer.ui.screen.main.settings

import android.os.Build
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.rememberScrollState
Expand Down Expand Up @@ -48,7 +49,6 @@ import com.infomaniak.swisstransfer.ui.theme.Margin
import com.infomaniak.swisstransfer.ui.theme.SwissTransferTheme
import com.infomaniak.swisstransfer.ui.utils.GetSetCallbacks
import com.infomaniak.swisstransfer.ui.utils.PreviewAllWindows
import android.os.Build

@Composable
fun SettingsScreen(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ fun NewTransferNavHost(navController: NavHostController, closeActivity: () -> Un
UploadSuccessScreen(
transferType = args.transferType,
transferUrl = args.transferUrl,
closeActivity = closeActivity
closeActivity = closeActivity,
)
}
composable<UploadErrorDestination> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ fun ImportFilesScreen(
resetSendActionResult = importFilesViewModel::resetSendActionResult,
)


LaunchedEffect(Unit) { importFilesViewModel.initTransferOptionsValues() }

val transferOptionsCallbacks = importFilesViewModel.getTransferOptionsCallbacks(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ class UploadFileTask(
val totalChunks = fileChunkSizeManager.computeFileChunks(fileSize = uploadFileSession.size, fileChunkSize = chunkSize)
val parallelChunks = fileChunkSizeManager.computeParallelChunks(fileChunkSize = chunkSize)


SentryLog.d(TAG, "chunkSize:$chunkSize | totalChunks:$totalChunks | parallelChunks:$parallelChunks")

uploadFileSession.getLocalIoFile(uploadSession.uuid).inputStream().buffered().use { inputStream ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ class UploadWorker @AssistedInject constructor(

companion object {
private const val TAG = "UploadWorker"
private const val EXPECTED_CHUNK_SIZE = 50L * 1024 * 1024 // 50Mo
private const val TOTAL_FILE_SIZE = 50L * 1024 * 1024 * 1024 // 50Go
private const val EXPECTED_CHUNK_SIZE = 50L * 1024 * 1024 // 50 Mo
private const val TOTAL_FILE_SIZE = 50L * 1024 * 1024 * 1024 // 50 Go
private const val MAX_CHUNK_COUNT = (TOTAL_FILE_SIZE / EXPECTED_CHUNK_SIZE).toInt()

private const val UPLOADED_BYTES_TAG = "uploaded_bytes_tag"
Expand Down

0 comments on commit aa29634

Please sign in to comment.