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

Commit

Permalink
Remove duplicate 'no project' item from autocomplete (mac)
Browse files Browse the repository at this point in the history
  • Loading branch information
IndrekV committed Aug 22, 2018
1 parent 083405a commit 947a77a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/ui/osx/TogglDesktop/test2/LiteAutoCompleteDataSource.m
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ - (void)displayAutocomplete:(NSMutableArray *)entries
self.lastType = -1;
self.lastClientLabel = nil;
self.lastWID = -1;
BOOL noProjectAdded = NO;
[self.orderedKeys removeAllObjects];
[self.dictionary removeAllObjects];
for (AutocompleteItem *item in entries)
Expand Down Expand Up @@ -117,13 +118,14 @@ - (void)displayAutocomplete:(NSMutableArray *)entries
self.lastType = item.Type;

// Add 'No project' item
if (item.Type == 2)
if (item.Type == 2 && !noProjectAdded)
{
AutocompleteItem *it = [[AutocompleteItem alloc] init];
it.Type = 2;
it.Text = @"No project";
it.ProjectAndTaskLabel = @"";
[self addItem:it];
noProjectAdded = YES;
}
}

Expand Down

0 comments on commit 947a77a

Please sign in to comment.