fix(web): circular dependencies (#1882)

This commit is contained in:
ze0s 2024-12-19 13:34:13 +01:00 committed by GitHub
parent 4432dfb099
commit 80423d6273
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 24 additions and 23 deletions

View file

@ -4,9 +4,9 @@
*/
import { useMutation, useQuery } from "@tanstack/react-query";
import { getRouteApi } from "@tanstack/react-router";
import { toast } from "react-hot-toast";
import { SettingsIndexRoute } from "@app/routes";
import { APIClient } from "@api/APIClient";
import { ConfigQueryOptions, UpdatesQueryOptions } from "@api/queries";
import { SettingsKeys } from "@api/query_keys";
@ -20,8 +20,8 @@ import { Section, RowItem } from "./_components";
function ApplicationSettings() {
const [settings, setSettings] = SettingsContext.use();
const ctx = SettingsIndexRoute.useRouteContext()
const queryClient = ctx.queryClient
const settingsIndexRoute = getRouteApi("/auth/authenticated-routes/settings/");
const { queryClient } = settingsIndexRoute.useRouteContext();
const { isError:isConfigError, error: configError, data } = useQuery(ConfigQueryOptions());
if (isConfigError) {

View file

@ -4,13 +4,13 @@
*/
import { useMutation, useSuspenseQuery } from "@tanstack/react-query";
import { getRouteApi } from "@tanstack/react-router";
import { toast } from "react-hot-toast";
import Select from "react-select";
import { APIClient } from "@api/APIClient";
import { ConfigQueryOptions } from "@api/queries";
import { SettingsKeys } from "@api/query_keys";
import { SettingsLogRoute } from "@app/routes";
import Toast from "@components/notifications/Toast";
import { LogLevelOptions, SelectOption } from "@domain/constants";
@ -58,8 +58,8 @@ const SelectWrapper = ({ id, value, onChange, options }: SelectWrapperProps) =>
);
function LogSettings() {
const ctx = SettingsLogRoute.useRouteContext()
const queryClient = ctx.queryClient
const settingsLogRoute = getRouteApi("/auth/authenticated-routes/settings/logs");
const { queryClient} = settingsLogRoute.useRouteContext();
const configQuery = useSuspenseQuery(ConfigQueryOptions())