feat: handle break change update

This commit is contained in:
MystiPanda
2024-06-22 21:03:49 +08:00
parent aba2ce8390
commit b98d9c2932
5 changed files with 16 additions and 0 deletions

View File

@@ -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) {