Toast component and use for copy-as-curl

This commit is contained in:
Gregory Schier
2024-05-10 12:37:04 -07:00
parent b533a01677
commit 582da26574
14 changed files with 285 additions and 101 deletions

View File

@@ -250,15 +250,13 @@ export const RequestPane = memo(function RequestPane({
if (!command.startsWith('curl ')) {
return;
}
if (
await confirm({
id: 'paste-curl',
title: 'Import from Curl?',
description:
'Do you want to overwrite the current request with the Curl command?',
confirmText: 'Overwrite',
})
) {
const confirmed = await confirm({
id: 'paste-curl',
title: 'Import from Curl?',
description: 'Do you want to overwrite the current request with the Curl command?',
confirmText: 'Overwrite',
});
if (confirmed) {
importCurl.mutate({ requestId: activeRequestId, command });
}
}}