Skip to content

Commit

Permalink
fix: validate entry activities
Browse files Browse the repository at this point in the history
  • Loading branch information
jonandernovella committed Sep 8, 2023
1 parent aea5749 commit 55106ae
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions frontend/src/components/QuickAdd.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ export const QuickAdd = ({
context
);
if (!didCancel && result) {
setActivities(result.time_entry_activities);
setActivity(activity ? activity : result.time_entry_activities[0]);
setActivities(result.time_entry_activities ? result.time_entry_activities : []);
setActivity(activity ? activity : Array.isArray(result.time_entry_activities) ? result.time_entry_activities[0] : null);
}
};

Expand Down Expand Up @@ -80,7 +80,6 @@ export const QuickAdd = ({
candidateIssues = [foundIssue];
//allow for valid issue id autoselection
if (isNumber(search.text)) {
console.log(foundIssue)
setIssue(foundIssue);
}
} else {
Expand All @@ -105,7 +104,6 @@ export const QuickAdd = ({
);

const suggestionSelected = (selection: Issue) => {
console.log(selection)
setIssue(selection);
// Update input box with selected issue
let element = issueInputRef.current;
Expand Down

0 comments on commit 55106ae

Please sign in to comment.