File tree Expand file tree Collapse file tree
java/com/nextcloud/client/assistant Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -238,7 +238,6 @@ class AssistantViewModel(
238238 val result = remoteRepository.translate(input, taskType)
239239 if (result.isSuccess) {
240240 _isTranslationTaskCreated .update { true }
241- // TODO: Select newly created translation task
242241
243242 val selectedTaskId = selectedTask.value?.id ? : return @launch
244243
@@ -420,6 +419,14 @@ class AssistantViewModel(
420419 }
421420
422421 fun selectTask (task : Task ? ) {
422+ viewModelScope.launch {
423+ if (task?.isTranslate() == true ) {
424+ _selectedTaskType .value?.let {
425+ pollTranslationResult(it, task.id)
426+ }
427+ }
428+ }
429+
423430 selectedTask.update {
424431 task
425432 }
Original file line number Diff line number Diff line change @@ -109,8 +109,7 @@ fun TranslationScreen(
109109 .padding(16 .dp)
110110 .padding(top = 32 .dp),
111111 floatingActionButton = {
112- if (! isTaskExists) {
113- // TODO: After first task creation dont allow user to create another back to back
112+ if (! isTaskExists && ! isTranslationTaskCreated) {
114113 FloatingActionButton (onClick = {
115114 val originLang = sourceState.language
116115 val targetLang = targetState.language
Original file line number Diff line number Diff line change 8181 <string name =" assistant_task_status_failed" >failed</string >
8282
8383 <!-- Translation Screen -->
84+ <string name =" assistant_screen_select_task" >Please select task</string >
8485 <string name =" translation_screen_label_from" >Translate from: </string >
8586 <string name =" translation_screen_label_to" >Translate to: </string >
87+ <string name =" translation_screen_translating" >Translating…</string >
88+ <string name =" translation_screen_start_to_translate_task" >Press the button to translate</string >
8689 <string name =" translation_screen_hint_source" >Enter text to translate…</string >
87- <string name =" translation_screen_hint_target" >Translation will appear here…</string >
90+ <string name =" translation_screen_error_message" >Translation model not exists.</string >
91+ <string name =" translation_screen_task_processing" >Translation is taking longer than expected.</string >
8892
8993 <!-- Conversation Screen -->
9094 <string name =" conversation_screen_title" >Conversations</string >
You can’t perform that action at this time.
0 commit comments