Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion packages/insomnia/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,13 @@
"@stoplight/spectral-rulesets": "^1.22.1",
"@tailwindcss/typography": "^0.5.16",
"@tanstack/react-virtual": "3.13.12",
"@tanstack/react-query": "^5.101.0",
"@xmldom/xmldom": "^0.9.8",
"acorn": "^8.16.0",
"acorn-walk": "^8.3.5",
"ajv": "^8.17.1",
"assert": "^2.1.0",
"apiconnect-wsdl": "2.0.36",
"assert": "^2.1.0",
"aws4": "^1.13.2",
"blakejs": "^1.2.1",
"buffer": "^6.0.3",
Expand Down
21 changes: 11 additions & 10 deletions packages/insomnia/src/root.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { config } from '@fortawesome/fontawesome-svg-core';
import { QueryClientProvider } from '@tanstack/react-query';
import type { IpcRendererEvent } from 'electron';
import type { Settings, UserSession } from 'insomnia-data';
import { models, services } from 'insomnia-data';
Expand All @@ -19,7 +20,6 @@ import {
useNavigate,
useParams,
useRevalidator,
useRouteLoaderData,
} from 'react-router';
import { useLatest } from 'react-use';

Expand All @@ -30,7 +30,6 @@ import { plugins } from '~/plugins/renderer-bridge';
import { useAuthorizeActionFetcher } from '~/routes/auth.authorize';
import { useDefaultBrowserRedirectActionFetcher } from '~/routes/auth.default-browser-redirect';
import { useLogoutFetcher } from '~/routes/auth.logout';
import { useCreateCloudCredentialActionFetcher } from '~/routes/cloud-credentials.create';
import {
GIT_PROVIDER_COMPLETE_SIGN_IN_FETCHER_KEY,
useGitProviderCompleteSignInFetcher,
Expand All @@ -48,6 +47,8 @@ import { SettingsModal } from '~/ui/components/modals/settings-modal';
import { Toaster } from '~/ui/components/toast-notification';
import { AppHooks } from '~/ui/containers/app-hooks';
import cssHref from '~/ui/css/styles.css?url';
import { dbQueryClient } from '~/ui/db-query-client';
import { useCreateCloudCredential, useSettings, useUserSession } from '~/ui/hooks/data';
import Modals from '~/ui/modals';

import type { Route } from './+types/root';
Expand Down Expand Up @@ -199,25 +200,25 @@ export const ErrorBoundary: FC<Route.ErrorBoundaryProps> = ({ error }) => {

export interface RootLoaderData {
settings: Settings;
workspaceCount: number;
userSession: UserSession;
}

export const useRootLoaderData = () => {
return useRouteLoaderData<typeof clientLoader>('root');
const settings = useSettings();
const userSession = useUserSession();
return {
settings,
userSession,
};
};

export async function clientLoader(_args: Route.ClientLoaderArgs) {
const settings = await services.settings.get();
const workspaceCount = await services.workspace.count();
const userSession = await services.userSession.get();
const cloudCredentials = await services.cloudCredential.all();

return {
settings,
workspaceCount,
userSession,
cloudCredentials,
};
}

Expand Down Expand Up @@ -279,7 +280,7 @@ export const Layout = ({ children }: { children: React.ReactNode }) => {
<Links />
</head>
<body className="size-full">
{children}
<QueryClientProvider client={dbQueryClient}>{children}</QueryClientProvider>
<ScrollRestoration />
<Scripts />
<div id="graphql-explorer-container" />
Expand Down Expand Up @@ -369,7 +370,7 @@ const Root = () => {
};

const [importObject, setImportObject] = useState<ImportSource>({ type: 'clipboard', defaultValue: '' });
const { submit: createCloudCredentials } = useCreateCloudCredentialActionFetcher();
const { mutate: createCloudCredentials } = useCreateCloudCredential();
const { submit: authorizeSubmit } = useAuthorizeActionFetcher();
const { submit: redirectToDefaultBrowserSubmit } = useDefaultBrowserRedirectActionFetcher();
const { submit: gitProviderCompleteSignInSubmit } = useGitProviderCompleteSignInFetcher({
Expand Down

This file was deleted.

This file was deleted.

64 changes: 0 additions & 64 deletions packages/insomnia/src/routes/cloud-credentials.create.tsx

This file was deleted.

28 changes: 0 additions & 28 deletions packages/insomnia/src/routes/settings.update.tsx

This file was deleted.

4 changes: 1 addition & 3 deletions packages/insomnia/src/routes/trial.check.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ import { href } from 'react-router';

import { createFetcherLoadHook } from '~/utils/router';

import type { Route } from './+types/settings.update';

export async function clientLoader(_args: Route.ClientLoaderArgs) {
export async function clientLoader() {
const { id: sessionId } = await services.userSession.get();

if (!sessionId) {
Expand Down
4 changes: 1 addition & 3 deletions packages/insomnia/src/routes/trial.start.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ import { services } from 'insomnia-data';
import { syncCurrentPlan } from '~/ui/organization-utils';
import { createFetcherSubmitHook } from '~/utils/router';

import type { Route } from './+types/settings.update';

export async function clientAction(_args: Route.ClientActionArgs) {
export async function clientAction() {
const { id: sessionId, accountId } = await services.userSession.get();

if (!sessionId || !accountId) {
Expand Down
Loading
Loading