mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-29 13:41:51 +02:00
Add test actions to copy-curl plugin and add WebSocket request actions to Sidebar
This commit is contained in:
@@ -37,6 +37,7 @@ import { getCreateDropdownItems } from '../hooks/useCreateDropdownItems';
|
||||
import { getGrpcRequestActions } from '../hooks/useGrpcRequestActions';
|
||||
import { useHotKey } from '../hooks/useHotKey';
|
||||
import { getHttpRequestActions } from '../hooks/useHttpRequestActions';
|
||||
import { getWebSocketRequestActions } from '../hooks/useWebSocketRequestActions';
|
||||
import { getWorkspaceActions } from '../hooks/useWorkspaceActions';
|
||||
import { getFolderActions } from '../hooks/useFolderActions';
|
||||
import { useListenToTauriEvent } from '../hooks/useListenToTauriEvent';
|
||||
@@ -376,6 +377,17 @@ function Sidebar({ className }: { className?: string }) {
|
||||
if (request != null) await a.call(request);
|
||||
},
|
||||
})),
|
||||
...(items.length === 1 && child.model === 'websocket_request'
|
||||
? await getWebSocketRequestActions()
|
||||
: []
|
||||
).map((a) => ({
|
||||
label: a.label,
|
||||
leftSlot: <Icon icon={a.icon ?? 'empty'} />,
|
||||
onSelect: async () => {
|
||||
const request = getModel('websocket_request', child.id);
|
||||
if (request != null) await a.call(request);
|
||||
},
|
||||
})),
|
||||
...(items.length === 1 && child.model === 'workspace'
|
||||
? await getWorkspaceActions()
|
||||
: []
|
||||
|
||||
Reference in New Issue
Block a user