From 38f1dcead5cb7c79bf4603c08a8131c00e8a3bab Mon Sep 17 00:00:00 2001 From: James Gatz Date: Tue, 12 Mar 2024 16:44:04 +0100 Subject: [PATCH] fix redirect after pull (#7168) --- packages/insomnia/src/ui/routes/remote-collections.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/insomnia/src/ui/routes/remote-collections.tsx b/packages/insomnia/src/ui/routes/remote-collections.tsx index 066185bba..0edc02067 100644 --- a/packages/insomnia/src/ui/routes/remote-collections.tsx +++ b/packages/insomnia/src/ui/routes/remote-collections.tsx @@ -14,7 +14,7 @@ import { RequestGroup } from '../../models/request-group'; import { UnitTest } from '../../models/unit-test'; import { UnitTestSuite } from '../../models/unit-test-suite'; import { WebSocketRequest } from '../../models/websocket-request'; -import { Workspace } from '../../models/workspace'; +import { scopeToActivity, Workspace } from '../../models/workspace'; import { BackendProject, Snapshot, @@ -161,8 +161,13 @@ export const pullRemoteCollectionAction: ActionFunction = async ({ remoteProject: project, }); + const workspace = await models.workspace.getById(workspaceId); + + invariant(workspace, 'Workspace not found'); + const activity = scopeToActivity(workspace?.scope); + return redirect( - `/organization/${organizationId}/project/${projectId}/workspace/${workspaceId}/debug` + `/organization/${organizationId}/project/${projectId}/workspace/${workspaceId}/${activity}` ); };