mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-19 07:53:54 +01:00
New sidebar and folder view (#263)
This commit is contained in:
28
src-web/commands/moveToWorkspace.tsx
Normal file
28
src-web/commands/moveToWorkspace.tsx
Normal file
@@ -0,0 +1,28 @@
|
||||
import type { GrpcRequest, HttpRequest, WebsocketRequest } from '@yaakapp-internal/models';
|
||||
import React from 'react';
|
||||
import { MoveToWorkspaceDialog } from '../components/MoveToWorkspaceDialog';
|
||||
import { activeWorkspaceIdAtom } from '../hooks/useActiveWorkspace';
|
||||
import { createFastMutation } from '../hooks/useFastMutation';
|
||||
import { showDialog } from '../lib/dialog';
|
||||
import { jotaiStore } from '../lib/jotai';
|
||||
|
||||
export const moveToWorkspace = createFastMutation({
|
||||
mutationKey: ['move_workspace'],
|
||||
mutationFn: async (request: HttpRequest | GrpcRequest | WebsocketRequest) => {
|
||||
const activeWorkspaceId = jotaiStore.get(activeWorkspaceIdAtom);
|
||||
if (activeWorkspaceId == null) return;
|
||||
|
||||
showDialog({
|
||||
id: 'change-workspace',
|
||||
title: 'Move Workspace',
|
||||
size: 'sm',
|
||||
render: ({ hide }) => (
|
||||
<MoveToWorkspaceDialog
|
||||
onDone={hide}
|
||||
request={request}
|
||||
activeWorkspaceId={activeWorkspaceId}
|
||||
/>
|
||||
),
|
||||
});
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user