mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-18 14:59:42 +02:00
Remove useToast everywhere
This commit is contained in:
@@ -1,17 +1,15 @@
|
||||
import { useFastMutation } from './useFastMutation';
|
||||
import { save } from '@tauri-apps/plugin-dialog';
|
||||
import type { HttpResponse } from '@yaakapp-internal/models';
|
||||
import mime from 'mime';
|
||||
import slugify from 'slugify';
|
||||
import { InlineCode } from '../components/core/InlineCode';
|
||||
import { useToast } from './useToast';
|
||||
import type { HttpResponse } from '@yaakapp-internal/models';
|
||||
import { getContentTypeHeader } from '../lib/model_util';
|
||||
import { getHttpRequest } from '../lib/store';
|
||||
import { invokeCmd } from '../lib/tauri';
|
||||
import { useFastMutation } from './useFastMutation';
|
||||
import { showToast } from '../lib/toast';
|
||||
|
||||
export function useSaveResponse(response: HttpResponse) {
|
||||
const toast = useToast();
|
||||
|
||||
return useFastMutation({
|
||||
mutationKey: ['save_response', response.id],
|
||||
mutationFn: async () => {
|
||||
@@ -26,7 +24,7 @@ export function useSaveResponse(response: HttpResponse) {
|
||||
title: 'Save Response',
|
||||
});
|
||||
await invokeCmd('cmd_save_response', { responseId: response.id, filepath });
|
||||
toast.show({
|
||||
showToast({
|
||||
message: (
|
||||
<>
|
||||
Response saved to <InlineCode>{filepath}</InlineCode>
|
||||
|
||||
Reference in New Issue
Block a user