From 979cf042f0774bc2abca3bd87f5a91c2ee9a6dae Mon Sep 17 00:00:00 2001 From: archy Date: Sat, 30 Sep 2023 20:57:25 +0800 Subject: [PATCH] remove SegmentEvent --- packages/insomnia/package.json | 5 ++++- packages/insomnia/src/ui/routes/actions.tsx | 12 +----------- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/packages/insomnia/package.json b/packages/insomnia/package.json index e81b2f0d7..aced15b8b 100644 --- a/packages/insomnia/package.json +++ b/packages/insomnia/package.json @@ -8,6 +8,9 @@ "bugs": { "url": "https://github.com/Kong/insomnia/issues" }, + "build": { + "asar": true + }, "repository": { "type": "git", "url": "git+https://github.com/Kong/insomnia.git", @@ -26,7 +29,7 @@ "start": "concurrently -n dev,app --kill-others \"npm run start:dev-server\" \"npm run start:electron\"", "start:dev-server": "vite dev", "start:electron": "cross-env NODE_ENV=development esr esbuild.main.ts && electron .", - "test": "jest", + "test": "jest", "electron:dev-build": "electron ./build/main.min.js", "test:watch": "jest --watch", "type-check": "tsc --noEmit --project tsconfig.build.json", diff --git a/packages/insomnia/src/ui/routes/actions.tsx b/packages/insomnia/src/ui/routes/actions.tsx index 7c2f4a264..133cf5859 100644 --- a/packages/insomnia/src/ui/routes/actions.tsx +++ b/packages/insomnia/src/ui/routes/actions.tsx @@ -72,7 +72,6 @@ export const deleteProjectAction: ActionFunction = async ({ params }) => { await models.stats.incrementDeletedRequestsForDescendents(project); await models.project.remove(project); - window.main.trackSegmentEvent({ event: SegmentEvent.projectLocalDelete }); return redirect(`/organization/${DEFAULT_ORGANIZATION_ID}/project/${DEFAULT_PROJECT_ID}`); }; @@ -128,11 +127,7 @@ export const createNewWorkspaceAction: ActionFunction = async ({ } } - window.main.trackSegmentEvent({ - event: isCollection(workspace) - ? SegmentEvent.collectionCreate - : SegmentEvent.documentCreate, - }); + return redirect( `/organization/${organizationId}/project/${projectId}/workspace/${workspace._id}/${workspace.scope === 'collection' ? ACTIVITY_DEBUG : ACTIVITY_SPEC @@ -282,7 +277,6 @@ export const createNewTestSuiteAction: ActionFunction = async ({ name, }); - window.main.trackSegmentEvent({ event: SegmentEvent.testSuiteCreate }); return redirect(`/organization/${organizationId}/project/${projectId}/workspace/${workspaceId}/test/test-suite/${unitTestSuite._id}`); }; @@ -299,7 +293,6 @@ export const deleteTestSuiteAction: ActionFunction = async ({ params }) => { await models.unitTestSuite.remove(unitTestSuite); - window.main.trackSegmentEvent({ event: SegmentEvent.testSuiteDelete }); return redirect(`/organization/${organizationId}/project/${projectId}/workspace/${workspaceId}/test`); }; @@ -378,7 +371,6 @@ expect(response1.status).to.equal(200);`, name, }); - window.main.trackSegmentEvent({ event: SegmentEvent.unitTestCreate }); return null; }; @@ -394,7 +386,6 @@ export const deleteTestAction: ActionFunction = async ({ params }) => { invariant(unitTest, 'Test not found'); await models.unitTest.remove(unitTest); - window.main.trackSegmentEvent({ event: SegmentEvent.unitTestDelete }); return null; }; @@ -450,7 +441,6 @@ export const runTestAction: ActionFunction = async ({ params }) => { parentId: unitTest.parentId, }); - window.main.trackSegmentEvent({ event: SegmentEvent.unitTestRun }); return redirect(`/organization/${organizationId}/project/${projectId}/workspace/${workspaceId}/test/test-suite/${testSuiteId}/test-result/${testResult._id}`); };