mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-01-29 08:45:41 +08:00
feat: handle break change update
This commit is contained in:
@@ -44,11 +44,23 @@ export const UpdateViewer = forwardRef<DialogRef>((props, ref) => {
|
||||
return updateInfo?.manifest?.body;
|
||||
}, [updateInfo]);
|
||||
|
||||
const breakChangeFlag = useMemo(() => {
|
||||
if (!updateInfo?.manifest?.body) {
|
||||
return false;
|
||||
}
|
||||
return updateInfo?.manifest?.body.toLowerCase().includes("break change");
|
||||
}, [updateInfo]);
|
||||
|
||||
const onUpdate = useLockFn(async () => {
|
||||
if (portableFlag) {
|
||||
Notice.error(t("Portable Updater Error"));
|
||||
return;
|
||||
}
|
||||
if (!updateInfo?.manifest?.body) return;
|
||||
if (breakChangeFlag) {
|
||||
Notice.error(t("Break Change Update Error"));
|
||||
return;
|
||||
}
|
||||
if (updateState) return;
|
||||
setUpdateState(true);
|
||||
if (eventListener !== null) {
|
||||
|
||||
Reference in New Issue
Block a user