chore: only invoke useLiveData in root
This commit is contained in:
parent
31ac25d510
commit
771b87ae41
@ -6,7 +6,6 @@ import Notice from '~/components/Notice';
|
||||
import { loadContext } from '~/utils/config/headplane';
|
||||
import { loadConfig, patchConfig } from '~/utils/config/headscale';
|
||||
import { getSession } from '~/utils/sessions.server';
|
||||
import { useLiveData } from '~/utils/useLiveData';
|
||||
|
||||
import DNS from './components/dns';
|
||||
import Domains from './components/domains';
|
||||
@ -65,7 +64,6 @@ export async function action({ request }: ActionFunctionArgs) {
|
||||
}
|
||||
|
||||
export default function Page() {
|
||||
useLiveData({ interval: 5000 });
|
||||
const data = useLoaderData<typeof loader>();
|
||||
|
||||
const allNs: Record<string, string[]> = {};
|
||||
|
||||
@ -23,7 +23,6 @@ import { loadContext } from '~/utils/config/headplane';
|
||||
import { loadConfig } from '~/utils/config/headscale';
|
||||
import { pull } from '~/utils/headscale';
|
||||
import { getSession } from '~/utils/sessions.server';
|
||||
import { useLiveData } from '~/utils/useLiveData';
|
||||
|
||||
import { menuAction } from './action';
|
||||
import MenuOptions from './components/menu';
|
||||
@ -66,7 +65,6 @@ export async function action({ request }: ActionFunctionArgs) {
|
||||
export default function Page() {
|
||||
const { machine, magic, routes, users } = useLoaderData<typeof loader>();
|
||||
const [showRouting, setShowRouting] = useState(false);
|
||||
useLiveData({ interval: 1000 });
|
||||
|
||||
const expired =
|
||||
machine.expiry === '0001-01-01 00:00:00' ||
|
||||
|
||||
@ -11,7 +11,6 @@ import { loadContext } from '~/utils/config/headplane';
|
||||
import { loadConfig } from '~/utils/config/headscale';
|
||||
import { pull } from '~/utils/headscale';
|
||||
import { getSession } from '~/utils/sessions.server';
|
||||
import { useLiveData } from '~/utils/useLiveData';
|
||||
import { initAgentSocket, queryAgent } from '~/utils/ws-agent';
|
||||
|
||||
import Tooltip from '~/components/Tooltip';
|
||||
@ -56,7 +55,6 @@ export async function action({ request }: ActionFunctionArgs) {
|
||||
}
|
||||
|
||||
export default function Page() {
|
||||
useLiveData({ interval: 3000 });
|
||||
const data = useLoaderData<typeof loader>();
|
||||
|
||||
return (
|
||||
|
||||
@ -10,7 +10,6 @@ import { loadContext } from '~/utils/config/headplane';
|
||||
import { post, pull } from '~/utils/headscale';
|
||||
import { send } from '~/utils/res';
|
||||
import { getSession } from '~/utils/sessions.server';
|
||||
import { useLiveData } from '~/utils/useLiveData';
|
||||
import AuthKeyRow from './components/key';
|
||||
import AddPreAuthKey from './dialogs/new';
|
||||
|
||||
@ -122,7 +121,6 @@ export default function Page() {
|
||||
const { keys, users, server } = useLoaderData<typeof loader>();
|
||||
const [user, setUser] = useState('All');
|
||||
const [status, setStatus] = useState('Active');
|
||||
useLiveData({ interval: 3000 });
|
||||
|
||||
const filteredKeys = keys.filter((key) => {
|
||||
if (user !== 'All' && key.user !== user) {
|
||||
|
||||
@ -16,7 +16,6 @@ import { loadConfig } from '~/utils/config/headscale';
|
||||
import { del, post, pull } from '~/utils/headscale';
|
||||
import { send } from '~/utils/res';
|
||||
import { getSession } from '~/utils/sessions.server';
|
||||
import { useLiveData } from '~/utils/useLiveData';
|
||||
|
||||
import toast from '~/utils/toast';
|
||||
import Auth from './components/auth';
|
||||
@ -129,7 +128,6 @@ export default function Page() {
|
||||
const data = useLoaderData<typeof loader>();
|
||||
const [users, setUsers] = useState(data.users);
|
||||
const actionData = useActionData<typeof action>();
|
||||
useLiveData({ interval: 3000 });
|
||||
|
||||
useEffect(() => {
|
||||
if (!actionData) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user