Skip to content

Commit fb3eb3a

Browse files
committed
fix: update tab after moving request
1 parent 8df4139 commit fb3eb3a

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

packages/insomnia/src/routes/organization.$organizationId.project.$projectId.workspace.$workspaceId.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,9 @@ export const revalidateWorkspaceActiveRequest = async (requestId: string, worksp
363363
export const revalidateWorkspaceActiveRequestByFolder = async (requestGroup: RequestGroup, workspaceId: string) => {
364364
const docs = await database.withDescendants(requestGroup, models.request.type, [
365365
models.request.type,
366+
models.webSocketRequest.type,
367+
models.socketIORequest.type,
368+
models.grpcRequest.type,
366369
models.requestGroup.type,
367370
]);
368371
const workspaceMeta = await models.workspaceMeta.getByParentId(workspaceId);

packages/insomnia/src/ui/components/tabs/tab-list.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ import {
1212
} from 'react-aria-components';
1313
import { useParams } from 'react-router';
1414

15+
import { isGrpcRequest } from '~/models/grpc-request';
16+
import { isSocketIORequest } from '~/models/socket-io-request';
17+
import { isWebSocketRequest } from '~/models/websocket-request';
1518
import { useRequestNewActionFetcher } from '~/routes/organization.$organizationId.project.$projectId.workspace.$workspaceId.debug.request.new';
1619

1720
import { type ChangeBufferEvent, type ChangeType, database } from '../../../common/database';
@@ -177,7 +180,7 @@ export const OrganizationTabList = ({ showActiveStatus = true, currentPage = ''
177180
if (patchObj.parentId && !patchObj.metaSortKey && (patchObj.parentId as string).startsWith('wrk_')) {
178181
const workspace = await models.workspace.getById(patchObj.parentId);
179182
if (workspace) {
180-
if (isRequest(doc)) {
183+
if (isRequest(doc) || isWebSocketRequest(doc) || isGrpcRequest(doc) || isSocketIORequest(doc)) {
181184
updateTabById?.(doc._id, {
182185
workspaceId: workspace._id,
183186
workspaceName: workspace.name,
@@ -186,6 +189,9 @@ export const OrganizationTabList = ({ showActiveStatus = true, currentPage = ''
186189
} else if (isRequestGroup(doc)) {
187190
const folderEntities = await database.withDescendants(doc, models.request.type, [
188191
models.request.type,
192+
models.grpcRequest.type,
193+
models.webSocketRequest.type,
194+
models.socketIORequest.type,
189195
models.requestGroup.type,
190196
]);
191197
console.log('folderEntities:', folderEntities);

0 commit comments

Comments
 (0)