mirror of
https://github.com/usebruno/bruno.git
synced 2026-06-11 09:51:30 +00:00
Fix: duplicate toast when saving an example (#6952)
* chore: update saveRequest calls from example to include silent parameter - Modified multiple components to pass an additional `true` parameter to the `saveRequest` function, ensuring requests are saved silently when it comes to examples. - Added AGENTS.md to .gitignore to exclude it from version control. * feat: add success notifications for cloning, renaming and deleting examples * refactor: update saveRequest calls to handle success notifications for renaming and deleting examples * refactor: remove unused toast import from DeleteResponseExampleModal
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -55,6 +55,7 @@ bruno.iml
|
||||
|
||||
# Development plan files
|
||||
CLAUDE.md
|
||||
AGENTS.md
|
||||
*.plan.md
|
||||
|
||||
# packages dist
|
||||
|
||||
@@ -93,7 +93,7 @@ const ExampleTab = ({ tab, collection }) => {
|
||||
onSaveAndClose={() => {
|
||||
// For examples, we don't have a separate save action
|
||||
// The changes are saved automatically when the request is saved
|
||||
dispatch(saveRequest(item.uid, collection.uid));
|
||||
dispatch(saveRequest(item.uid, collection.uid, true));
|
||||
dispatch(closeTabs({
|
||||
tabUids: [tab.uid]
|
||||
}));
|
||||
|
||||
@@ -112,7 +112,7 @@ const ResponseBookmark = forwardRef(({ item, collection, responseSize, children
|
||||
}));
|
||||
|
||||
// Save the request
|
||||
await dispatch(saveRequest(item.uid, collection.uid));
|
||||
await dispatch(saveRequest(item.uid, collection.uid, true));
|
||||
|
||||
// Task middleware will track this and open the example in a new tab once the file is reloaded
|
||||
dispatch(insertTaskIntoQueue({
|
||||
|
||||
@@ -17,8 +17,10 @@ const DeleteResponseExampleModal = ({ onClose, example, item, collection }) => {
|
||||
collectionUid: collection.uid,
|
||||
exampleUid: example.uid
|
||||
}));
|
||||
dispatch(saveRequest(item.uid, collection.uid));
|
||||
onClose();
|
||||
dispatch(saveRequest(item.uid, collection.uid, true))
|
||||
.then(() => {
|
||||
onClose();
|
||||
});
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
@@ -86,7 +86,7 @@ const ExampleItem = ({ example, item, collection }) => {
|
||||
}));
|
||||
|
||||
// Save the request
|
||||
await dispatch(saveRequest(item.uid, collection.uid));
|
||||
await dispatch(saveRequest(item.uid, collection.uid, true));
|
||||
|
||||
// Task middleware will track this and open the example in a new tab once the file is reloaded
|
||||
dispatch(insertTaskIntoQueue({
|
||||
@@ -125,8 +125,11 @@ const ExampleItem = ({ example, item, collection }) => {
|
||||
name: newName
|
||||
}
|
||||
}));
|
||||
dispatch(saveRequest(item.uid, collection.uid));
|
||||
setShowRenameModal(false);
|
||||
dispatch(saveRequest(item.uid, collection.uid, true))
|
||||
.then(() => {
|
||||
toast.success(`Example renamed to "${newName}"`);
|
||||
setShowRenameModal(false);
|
||||
});
|
||||
};
|
||||
|
||||
// Build menu items for MenuDropdown
|
||||
|
||||
@@ -487,7 +487,7 @@ const CollectionItem = ({ item, collectionUid, collectionPathname, searchText })
|
||||
}));
|
||||
|
||||
// Save the request
|
||||
await dispatch(saveRequest(item.uid, collectionUid));
|
||||
await dispatch(saveRequest(item.uid, collectionUid, true));
|
||||
|
||||
// Task middleware will track this and open the example in a new tab once the file is reloaded
|
||||
dispatch(insertTaskIntoQueue({
|
||||
|
||||
Reference in New Issue
Block a user