File tree Expand file tree Collapse file tree
app/src/main/java/com/nextcloud/client/assistant Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -238,6 +238,7 @@ class AssistantViewModel(
238238 val result = remoteRepository.translate(input, taskType)
239239 if (result.isSuccess) {
240240 _isTranslationTaskCreated .update { true }
241+ // TODO: Select newly created translation task
241242
242243 val selectedTaskId = selectedTask.value?.id ? : return @launch
243244
Original file line number Diff line number Diff line change @@ -109,15 +109,18 @@ fun TranslationScreen(
109109 .padding(16 .dp)
110110 .padding(top = 32 .dp),
111111 floatingActionButton = {
112- FloatingActionButton (onClick = {
113- val originLang = sourceState.language
114- val targetLang = targetState.language
115- if (originLang != null && targetLang != null ) {
116- viewModel.translate(sourceState.text, originLang, targetLang)
117- }
118- }, content = {
119- Icon (painter = painterResource(R .drawable.ic_translate), contentDescription = " translate button" )
120- })
112+ if (! isTaskExists) {
113+ // TODO: After first task creation dont allow user to create another back to back
114+ FloatingActionButton (onClick = {
115+ val originLang = sourceState.language
116+ val targetLang = targetState.language
117+ if (originLang != null && targetLang != null ) {
118+ viewModel.translate(sourceState.text, originLang, targetLang)
119+ }
120+ }, content = {
121+ Icon (painter = painterResource(R .drawable.ic_translate), contentDescription = " translate button" )
122+ })
123+ }
121124 }
122125 ) { paddingValues ->
123126 LazyColumn (modifier = Modifier .padding(paddingValues)) {
You can’t perform that action at this time.
0 commit comments