Remove useToast everywhere

This commit is contained in:
Gregory Schier
2025-01-06 12:21:21 -08:00
parent ab55c2e0ce
commit 806a8eb801
14 changed files with 58 additions and 84 deletions

View File

@@ -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>