@lvce-editor/update-worker 1.6.0 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/updateWorkerMain.js +10 -0
- package/package.json +1 -1
package/dist/updateWorkerMain.js
CHANGED
|
@@ -1070,6 +1070,10 @@ const isCached = async (url, cache) => {
|
|
|
1070
1070
|
return false;
|
|
1071
1071
|
};
|
|
1072
1072
|
|
|
1073
|
+
const isOnline = () => {
|
|
1074
|
+
return navigator.onLine;
|
|
1075
|
+
};
|
|
1076
|
+
|
|
1073
1077
|
const shouldUpdate = async (updateSetting, version) => {
|
|
1074
1078
|
if (updateSetting && updateSetting !== 'none') {
|
|
1075
1079
|
return true;
|
|
@@ -1081,6 +1085,12 @@ const shouldUpdate = async (updateSetting, version) => {
|
|
|
1081
1085
|
|
|
1082
1086
|
const checkForUpdates = async (updateSetting, repository) => {
|
|
1083
1087
|
try {
|
|
1088
|
+
if (!isOnline()) {
|
|
1089
|
+
return {
|
|
1090
|
+
updated: false,
|
|
1091
|
+
error: undefined
|
|
1092
|
+
};
|
|
1093
|
+
}
|
|
1084
1094
|
const bucketName = 'electron-updates';
|
|
1085
1095
|
const cacheName = 'electron-updates';
|
|
1086
1096
|
const info = await getLatestReleaseVersion(repository);
|