Skip to content
This repository has been archived by the owner on Feb 13, 2024. It is now read-only.

Commit

Permalink
Don't overwrite description when pasting to timer input field (mac), c…
Browse files Browse the repository at this point in the history
…loses #2447
  • Loading branch information
IndrekV committed May 14, 2018
1 parent 7332b4c commit e632ea6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/ui/osx/TogglDesktop/test2/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -1277,10 +1277,15 @@ - (id)init
{
NSString *character = [theEvent charactersIgnoringModifiers];
NSString *windowName = [NSApp orderedWindows][0].frameAutosaveName;

NSResponder *currentFirstResponder = [self.mainWindowController.window firstResponder];
BOOL timerFocused = [currentFirstResponder isKindOfClass:[NSTextView class]];

// Execute only if edit view is not opened and focus is on main window
if ([character isEqualToString:@"v"]
&& ![self.mainWindowController isEditOpened]
&& [windowName isEqualToString:@"MainWindow"])
&& [windowName isEqualToString:@"MainWindow"]
&& !timerFocused)
{
if (self.lastKnownRunningTimeEntry == nil || self.lastKnownRunningTimeEntry.duration_in_seconds < 0)
{
Expand Down

0 comments on commit e632ea6

Please sign in to comment.