feat: proxy page use swr

This commit is contained in:
GyDi
2021-12-20 01:29:49 +08:00
parent 9d62462a96
commit 81aef736d6
3 changed files with 6 additions and 12 deletions

View File

@@ -1,6 +1,7 @@
import { useRef, useState } from "react";
import useSWR, { useSWRConfig } from "swr";
import { Box, Button, Grid, TextField, Typography } from "@mui/material";
import services from "../services";
import {
getProfiles,
importProfile,
@@ -35,6 +36,7 @@ const RulesPage = () => {
putProfiles(index)
.then(() => {
mutate("getProfiles", { ...profiles, current: index }, true);
mutate("getProxies", services.getProxies());
})
.catch((err) => {
console.error(err);