fix: adjust update profile notice error

This commit is contained in:
GyDi 2022-06-15 02:42:04 +08:00
parent ba16ec02e5
commit a4fb2dfcf8
No known key found for this signature in database
GPG Key ID: 58B15242BA8277A6

View File

@ -137,7 +137,10 @@ const ProfileItem = (props: Props) => {
await updateProfile(itemData.uid, { with_proxy: withProxy });
mutate("getProfiles");
} catch (err: any) {
Notice.error(err?.message || err.toString());
const errmsg = err?.message || err.toString();
Notice.error(
errmsg.replace(/error sending request for url (\S+?): /, "")
);
} finally {
setLoadingCache((cache) => ({ ...cache, [itemData.uid]: false }));
}