Skip to content

Commit

Permalink
fixes save behavior
Browse files Browse the repository at this point in the history
Signed-off-by: Ashwin P Chandran <[email protected]>
  • Loading branch information
ashwin-pc committed Aug 31, 2023
1 parent 24a1845 commit b62700b
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,7 @@ export const getTopNavLinks = (
});

if (id !== state.savedSearch) {
setTimeout(() => {
history().push(`/view/${encodeURIComponent(id)}`);
// TODO: figure out why a history push doesn't update the app state. The page reload is a hack around it
window.location.reload();
}, 0);
history().push(`/view/${encodeURIComponent(id)}`);
} else {
chrome.docTitle.change(savedSearch.lastSavedTitle);
chrome.setBreadcrumbs([
Expand All @@ -122,6 +118,8 @@ export const getTopNavLinks = (

// set App state to clean
store!.dispatch({ type: setSavedSearchId.type, payload: id });

return { id };
}
} catch (error) {
toastNotifications.addDanger({
Expand All @@ -136,9 +134,9 @@ export const getTopNavLinks = (

// Reset the original title
savedSearch.title = currentTitle;
}

return { test: true };
return { error };
}
};

const saveModal = (
Expand Down

0 comments on commit b62700b

Please sign in to comment.