Skip to content

Commit

Permalink
fix: clear translated text after switching languages
Browse files Browse the repository at this point in the history
  • Loading branch information
Bnyro committed Jan 31, 2024
1 parent df7691d commit 9a88ca6
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ import androidx.compose.ui.unit.dp
import androidx.navigation.NavController
import com.bnyro.translate.R
import com.bnyro.translate.obj.MenuItemData
import com.bnyro.translate.obj.Translation
import com.bnyro.translate.ui.components.LanguageSelector
import com.bnyro.translate.ui.models.TranslationModel
import com.bnyro.translate.ui.nav.Destination
Expand Down Expand Up @@ -155,6 +156,7 @@ fun TranslationPage(
viewModel.sourceLanguage = viewModel.targetLanguage
viewModel.targetLanguage = temp
viewModel.insertedText = viewModel.translation.translatedText
viewModel.translation = Translation("")
viewModel.translateNow()
}
) {
Expand Down

0 comments on commit 9a88ca6

Please sign in to comment.