Skip to content

Commit

Permalink
fix: return created tags to attach to captures (Greenstand#666)
Browse files Browse the repository at this point in the history
  • Loading branch information
nmcharlton authored May 21, 2022
1 parent f949473 commit 83bcfed
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/context/TagsContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,14 @@ export function TagsProvider(props) {
/*
* check for new tags in tagInput and add them to the database
*/
const createTags = () => {
const savedTags = tagInput.map(async (t) => {
const createTags = async () => {
const promises = tagInput.map(async (t) => {
return api.createTag(t);
});

return Promise.all(savedTags).then(loadTags);
const savedTags = await Promise.all(promises);
// Refresh the tag list
loadTags();
return savedTags;
};

const value = {
Expand Down

0 comments on commit 83bcfed

Please sign in to comment.