From ae3f38ebfb452f0cf7ef1b349885c40c3e79ccb0 Mon Sep 17 00:00:00 2001 From: Andrii Nester Date: Tue, 11 May 2021 12:51:56 +0300 Subject: [PATCH] Fix trimming hashtag from description after selecting autocomplete --- .../Timer/TimerViewController/TimerViewModel.swift | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/ui/osx/TogglDesktop/Features/Timer/TimerViewController/TimerViewModel.swift b/src/ui/osx/TogglDesktop/Features/Timer/TimerViewController/TimerViewModel.swift index 795fa39d9d..3e1816ced3 100644 --- a/src/ui/osx/TogglDesktop/Features/Timer/TimerViewController/TimerViewModel.swift +++ b/src/ui/osx/TogglDesktop/Features/Timer/TimerViewController/TimerViewModel.swift @@ -533,13 +533,6 @@ final class TimerViewModel: NSObject { // User has selected an autocomplete item. // It could be a time entry, a task or a project. - if let newDescription = autocompleteItem.description { - entryDescription = newDescription - if timeEntry.isRunning() { - saveCurrentDescription() - } - } - fillEntryProject(from: autocompleteItem) selectedTags = autocompleteItem.tags ?? [] @@ -549,6 +542,13 @@ final class TimerViewModel: NSObject { } else { billableState = .unavailable } + + if let newDescription = autocompleteItem.description { + entryDescription = newDescription + if timeEntry.isRunning() { + saveCurrentDescription() + } + } } private func fillEntryProject(from autocompleteItem: AutocompleteItem) {