mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-17 23:14:03 +01:00
Add command palette (#46)
This PR finished the initial PoC command palette. It currently only supports switching between requests and workspaces, but can easily be extended for more.
This commit is contained in:
@@ -4,10 +4,8 @@ import type { Workspace } from '../lib/models';
|
||||
import { useAppRoutes } from './useAppRoutes';
|
||||
import { getRecentEnvironments } from './useRecentEnvironments';
|
||||
import { getRecentRequests } from './useRecentRequests';
|
||||
import { useSettings } from './useSettings';
|
||||
|
||||
export function useOpenWorkspace() {
|
||||
const settings = useSettings();
|
||||
const routes = useAppRoutes();
|
||||
|
||||
return useMutation({
|
||||
@@ -18,7 +16,7 @@ export function useOpenWorkspace() {
|
||||
workspace: Workspace;
|
||||
inNewWindow: boolean;
|
||||
}) => {
|
||||
if (settings == null || workspace == null) return;
|
||||
if (workspace == null) return;
|
||||
|
||||
if (inNewWindow) {
|
||||
const environmentId = (await getRecentEnvironments(workspace.id))[0];
|
||||
|
||||
Reference in New Issue
Block a user