A bunch of changes, including moving prompt/confirm out of context

This commit is contained in:
Gregory Schier
2025-01-07 06:56:51 -08:00
parent 4776bbc753
commit 2f7b66fc92
41 changed files with 315 additions and 353 deletions

View File

@@ -1,13 +1,11 @@
import type { CookieJar } from '@yaakapp-internal/models';
import { trackEvent } from '../lib/analytics';
import { showPrompt } from '../lib/prompt';
import { invokeCmd } from '../lib/tauri';
import { getActiveWorkspaceId } from './useActiveWorkspace';
import { useFastMutation } from './useFastMutation';
import { usePrompt } from './usePrompt';
export function useCreateCookieJar() {
const prompt = usePrompt();
return useFastMutation<CookieJar | null>({
mutationKey: ['create_cookie_jar'],
mutationFn: async () => {
@@ -15,7 +13,7 @@ export function useCreateCookieJar() {
if (workspaceId == null) {
throw new Error("Cannot create cookie jar when there's no active workspace");
}
const name = await prompt({
const name = await showPrompt({
id: 'new-cookie-jar',
title: 'New CookieJar',
placeholder: 'My Jar',