Skip to content

Commit

Permalink
Remove logging statements and unused imports
Browse files Browse the repository at this point in the history
  • Loading branch information
f-arslan committed Jan 28, 2024
1 parent fe316eb commit 219e598
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
package com.espressodev.gptmap.api.palm.impl

import android.util.Log
import com.espressodev.gptmap.api.palm.PalmApi
import com.espressodev.gptmap.api.palm.PalmService
import com.espressodev.gptmap.core.model.Location
import com.espressodev.gptmap.core.model.ext.classTag
import com.espressodev.gptmap.core.model.PromptUtil.locationPreText
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
Expand All @@ -14,7 +12,6 @@ class PalmServiceImpl(private val palmApi: PalmApi) : PalmService {
withContext(Dispatchers.IO) {
try {
palmApi.generateText(locationPreText + textContent).toLocation().let {
Log.d(classTag(), it.content.toString())
Result.success(it)
}
} catch (e: Exception) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ class UnsplashServiceImpl(private val unsplashApi: UnsplashApi) : UnsplashServic
response.isSuccessful.let { success ->
when {
success -> {
Log.d(classTag(), unsplashApi.getTwoPhotos(query).body().toString())
response.body()?.let {
Result.success(it)
} ?: Result.failure(Throwable(UnsplashApiException()))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ fun NavController.navigateToScreenshot(navOptions: NavOptions? = null) {
navigate(ScreenshotRoute, navOptions)
}

fun NavGraphBuilder.screenshotScreen(popUp: () -> Unit, navigateToMap: () -> Unit) {
fun NavGraphBuilder.screenshotScreen(popUp: () -> Unit) {
composable(ScreenshotRoute) {
ScreenshotRoute(popUp = popUp, navigateToMap = navigateToMap)
ScreenshotRoute(popUp = popUp)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ import com.espressodev.gptmap.core.designsystem.R.string as AppText
@Composable
fun ScreenshotRoute(
popUp: () -> Unit,
navigateToMap: () -> Unit,
viewModel: ScreenshotViewModel = hiltViewModel(),
) {
val uiState by viewModel.uiState.collectAsStateWithLifecycle()
Expand Down Expand Up @@ -115,7 +114,7 @@ fun ScreenshotRoute(
onSaveClick = {
viewModel.onEvent(
event = ScreenshotUiEvent.OnSaveClicked,
navigateToMap
navigate = popUp
)
}
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class ScreenshotViewModel @Inject constructor(
private val _uiState = MutableStateFlow(ScreenshotUiState())
val uiState = _uiState.asStateFlow()

fun onEvent(event: ScreenshotUiEvent, navigateToMap: () -> Unit = {}) {
fun onEvent(event: ScreenshotUiEvent, navigate: () -> Unit = {}) {
when (event) {
is ScreenshotUiEvent.OnBitmapChanged ->
_uiState.update { currentState ->
Expand All @@ -41,7 +41,7 @@ class ScreenshotViewModel @Inject constructor(

is ScreenshotUiEvent.OnTitleChanged -> _uiState.update { it.copy(title = event.value) }

ScreenshotUiEvent.OnSaveClicked -> onSaveClick(navigateToMap)
ScreenshotUiEvent.OnSaveClicked -> onSaveClick(navigate)
}
}

Expand Down

0 comments on commit 219e598

Please sign in to comment.