Skip to content

Commit fc68c33

Browse files
committed
more update changes
1 parent 153e5df commit fc68c33

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

src/containers/LoadingScreen/index.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,12 +272,20 @@ const LoadingScreen = ({ onEnd }: LoadingScreenProps) => {
272272
return true; // Continue without OMP plugin
273273
}
274274

275-
const versionInfo = response.data.versions[useAppState.getState().version];
275+
const versionInfo =
276+
response.data.versions[useAppState.getState().version];
276277

277278
if (versionInfo) {
278279
response.data.download = versionInfo.download;
279280
response.data.ompPluginChecksum = versionInfo.ompPluginChecksum;
280281
response.data.ompPluginDownload = versionInfo.ompPluginDownload;
282+
} else {
283+
const info = response.data.versions[response.data.version];
284+
if (info) {
285+
response.data.download = info.download;
286+
response.data.ompPluginChecksum = info.ompPluginChecksum;
287+
response.data.ompPluginDownload = info.ompPluginDownload;
288+
}
281289
}
282290

283291
updateInfo = response.data;

src/utils/helpers.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,19 @@ export const fetchUpdateInfo = async () => {
116116
const hostOS = await type();
117117
const response = await getUpdateInfo();
118118
if (response.data) {
119-
const versionInfo = response.data.versions[version];
119+
const versionInfo = response.data.versions[useAppState.getState().version];
120120

121121
if (versionInfo) {
122122
response.data.download = versionInfo.download;
123123
response.data.ompPluginChecksum = versionInfo.ompPluginChecksum;
124124
response.data.ompPluginDownload = versionInfo.ompPluginDownload;
125+
} else {
126+
const info = response.data.versions[response.data.version];
127+
if (info) {
128+
response.data.download = info.download;
129+
response.data.ompPluginChecksum = info.ompPluginChecksum;
130+
response.data.ompPluginDownload = info.ompPluginDownload;
131+
}
125132
}
126133

127134
useAppState.getState().setUpdateInfo(response.data);

0 commit comments

Comments
 (0)