Skip to content

Commit

Permalink
Added notifications for "clear links" and "star links"
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexeyOplachko committed Mar 16, 2022
1 parent 7b65a18 commit 4eec612
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/plugins/queryhistory/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -865,6 +865,17 @@ const QueryHistoryDrawer = (props) => {
const updatedItem = { ...item, starred: item.starred ? false : true };
const updated = linkService.update(updatedItem);
dispatch(setLinksHistory(updated));
if (updatedItem.starred) {
dispatch(createAlert({
message: "Link starred succesfully",
type: notificationTypes.success
}))
} else {
dispatch(createAlert({
message: "Link unstarred succesfully",
type: notificationTypes.success
}))
}
}
function copyQuery(item) {
navigator.clipboard.writeText(item).then(
Expand Down Expand Up @@ -898,6 +909,12 @@ const QueryHistoryDrawer = (props) => {
function clearLinksHistory() {
const historyClean = linkService.clean();
dispatch(setLinksHistory(historyClean));
if (historyClean?.length < 1) {
dispatch(createAlert({
message: "Links History cleared succesfully",
type: notificationTypes.info
}))
}
}

function filterItems(list, item) {
Expand Down

0 comments on commit 4eec612

Please sign in to comment.