mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-23 18:01:08 +01:00
Remove useNavigate everywhere, and make request a query param. And convert dialog to Jotai
This commit is contained in:
@@ -1,14 +1,13 @@
|
||||
import type { HttpResponse } from '@yaakapp-internal/models';
|
||||
import { showAlert } from '../lib/alert';
|
||||
import { trackEvent } from '../lib/analytics';
|
||||
import { getHttpRequest } from '../lib/store';
|
||||
import { invokeCmd } from '../lib/tauri';
|
||||
import { getActiveCookieJar } from './useActiveCookieJar';
|
||||
import { getActiveEnvironment } from './useActiveEnvironment';
|
||||
import { useAlert } from './useAlert';
|
||||
import { useFastMutation } from './useFastMutation';
|
||||
|
||||
export function useSendAnyHttpRequest() {
|
||||
const alert = useAlert();
|
||||
return useFastMutation<HttpResponse | null, string, string | null>({
|
||||
mutationKey: ['send_any_request'],
|
||||
mutationFn: async (id) => {
|
||||
@@ -24,6 +23,6 @@ export function useSendAnyHttpRequest() {
|
||||
});
|
||||
},
|
||||
onSettled: () => trackEvent('http_request', 'send'),
|
||||
onError: (err) => alert({ id: 'send-failed', title: 'Send Failed', body: err }),
|
||||
onError: (err) => showAlert({ id: 'send-failed', title: 'Send Failed', body: err }),
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user