mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-21 08:21:19 +02:00
Focus request/folder after creation
This commit is contained in:
@@ -11,8 +11,8 @@ export async function createRequestAndNavigate<
|
||||
|
||||
if (patch.sortPriority === undefined) {
|
||||
if (activeRequest != null) {
|
||||
// Place above currently active request
|
||||
patch.sortPriority = activeRequest.sortPriority - 0.0001;
|
||||
// Place below the currently active request
|
||||
patch.sortPriority = activeRequest.sortPriority;
|
||||
} else {
|
||||
// Place at the very top
|
||||
patch.sortPriority = -Date.now();
|
||||
@@ -27,4 +27,5 @@ export async function createRequestAndNavigate<
|
||||
params: { workspaceId: patch.workspaceId },
|
||||
search: (prev) => ({ ...prev, request_id: newId }),
|
||||
});
|
||||
return newId;
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ export async function duplicateRequestOrFolderAndNavigate(
|
||||
|
||||
const newId = await duplicateModel(model);
|
||||
const workspaceId = jotaiStore.get(activeWorkspaceIdAtom);
|
||||
if (workspaceId == null) return;
|
||||
if (workspaceId == null || model.model === 'folder') return;
|
||||
|
||||
navigateToRequestOrFolderOrWorkspace(newId, model.model);
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ export function setWorkspaceSearchParams(
|
||||
(router as any).navigate({
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
search: (prev: any) => {
|
||||
console.log('Navigating to', { prev, search });
|
||||
// console.log('Navigating to', { prev, search });
|
||||
return { ...prev, ...search };
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user