mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-22 01:19:13 +01:00
Add .oxfmtignore to skip generated bindings and wasm-pack output. Add npm format script, update DEVELOPMENT.md for Vite+ toolchain, and format all non-generated files with oxfmt. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
34 lines
1.1 KiB
TypeScript
34 lines
1.1 KiB
TypeScript
import type { GrpcRequest, HttpRequest, WebsocketRequest } from "@yaakapp-internal/models";
|
|
|
|
import { MoveToWorkspaceDialog } from "../components/MoveToWorkspaceDialog";
|
|
import { activeWorkspaceIdAtom } from "../hooks/useActiveWorkspace";
|
|
import { createFastMutation } from "../hooks/useFastMutation";
|
|
import { pluralizeCount } from "../lib/pluralize";
|
|
import { showDialog } from "../lib/dialog";
|
|
import { jotaiStore } from "../lib/jotai";
|
|
|
|
export const moveToWorkspace = createFastMutation({
|
|
mutationKey: ["move_workspace"],
|
|
mutationFn: async (requests: (HttpRequest | GrpcRequest | WebsocketRequest)[]) => {
|
|
const activeWorkspaceId = jotaiStore.get(activeWorkspaceIdAtom);
|
|
if (activeWorkspaceId == null) return;
|
|
if (requests.length === 0) return;
|
|
|
|
const title =
|
|
requests.length === 1 ? "Move Request" : `Move ${pluralizeCount("Request", requests.length)}`;
|
|
|
|
showDialog({
|
|
id: "change-workspace",
|
|
title,
|
|
size: "sm",
|
|
render: ({ hide }) => (
|
|
<MoveToWorkspaceDialog
|
|
onDone={hide}
|
|
requests={requests}
|
|
activeWorkspaceId={activeWorkspaceId}
|
|
/>
|
|
),
|
|
});
|
|
},
|
|
});
|