mirror of
https://github.com/clash-verge-rev/clash-verge-rev
synced 2025-05-05 04:33:45 +08:00
fix: adjust notice
This commit is contained in:
parent
0070ec09a2
commit
e7b19a5f66
@ -11,7 +11,7 @@ interface InnerProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const NoticeInner = (props: InnerProps) => {
|
const NoticeInner = (props: InnerProps) => {
|
||||||
const { type, message, duration = 2000, onClose } = props;
|
const { type, message, duration = 1500, onClose } = props;
|
||||||
const [visible, setVisible] = useState(true);
|
const [visible, setVisible] = useState(true);
|
||||||
|
|
||||||
const onBtnClose = () => {
|
const onBtnClose = () => {
|
||||||
@ -79,7 +79,7 @@ const Notice: NoticeInstance = (props) => {
|
|||||||
|
|
||||||
const onUnmount = () => {
|
const onUnmount = () => {
|
||||||
const result = ReactDOM.unmountComponentAtNode(container);
|
const result = ReactDOM.unmountComponentAtNode(container);
|
||||||
if (result && parent) parent.removeChild(container);
|
if (result && parent) setTimeout(() => parent.removeChild(container), 300);
|
||||||
};
|
};
|
||||||
|
|
||||||
ReactDOM.render(<NoticeInner {...props} onClose={onUnmount} />, container);
|
ReactDOM.render(<NoticeInner {...props} onClose={onUnmount} />, container);
|
||||||
|
@ -49,7 +49,7 @@ const EnhancedMode = (props: Props) => {
|
|||||||
const onEnhance = useLockFn(async () => {
|
const onEnhance = useLockFn(async () => {
|
||||||
try {
|
try {
|
||||||
await enhanceProfiles();
|
await enhanceProfiles();
|
||||||
Notice.success("Refresh clash config", 2000);
|
Notice.success("Refresh clash config", 1000);
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
Notice.error(err.message || err.toString());
|
Notice.error(err.message || err.toString());
|
||||||
}
|
}
|
||||||
|
@ -122,6 +122,7 @@ const ProfilePage = () => {
|
|||||||
try {
|
try {
|
||||||
await selectProfile(uid);
|
await selectProfile(uid);
|
||||||
mutate("getProfiles", { ...profiles, current: uid }, true);
|
mutate("getProfiles", { ...profiles, current: uid }, true);
|
||||||
|
if (force) Notice.success("Refresh clash config", 1000);
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
Notice.error(err?.message || err.toString());
|
Notice.error(err?.message || err.toString());
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user