Skip to content
Snippets Groups Projects
Unverified Commit 781c67b3 authored by GyDi's avatar GyDi
Browse files

fix: service viewer ref

parent 020bd129
No related branches found
No related tags found
No related merge requests found
import useSWR from "swr";
import { forwardRef, useImperativeHandle, useState } from "react";
import { useLockFn } from "ahooks";
import { useTranslation } from "react-i18next";
import { Button, Stack, Typography } from "@mui/material";
......@@ -8,7 +9,6 @@ import {
uninstallService,
patchVergeConfig,
} from "@/services/cmds";
import { forwardRef, useState } from "react";
import { BaseDialog, DialogRef, Notice } from "@/components/base";
interface Props {
......@@ -27,6 +27,11 @@ export const ServiceViewer = forwardRef<DialogRef, Props>((props, ref) => {
{ revalidateIfStale: false, shouldRetryOnError: false }
);
useImperativeHandle(ref, () => ({
open: () => setOpen(true),
close: () => setOpen(false),
}));
const state = status != null ? status : "pending";
const onInstall = useLockFn(async () => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment