Skip to content

Commit

Permalink
fix: gfw return false if error
Browse files Browse the repository at this point in the history
  • Loading branch information
ci010 committed Aug 11, 2019
1 parent 839d038 commit b132200
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/store/modules/version.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,10 @@ const mod = {
* download a specific version from version metadata
*/
async installForge(context, meta) {
const maven = await inGFW.net().then(b => (b ? 'https://voxelauncher.azurewebsites.net/api/v1' : undefined)).catch(e => undefined);
const task = ForgeInstaller.installTask(meta, context.rootState.root, {
tempDir: join(context.rootState.root, 'temps'),
maven: await inGFW.net() ? 'https://voxelauncher.azurewebsites.net/api/v1' : undefined,
maven,
java: context.rootGetters.defaultJava.path,
});
const id = await context.dispatch('executeTask', task);
Expand Down Expand Up @@ -291,7 +292,7 @@ const mod = {

const cur = context.state.forge[version];
try {
if (await inGFW.net()) {
if (await inGFW.net().catch(_ => false)) {
const headers = cur ? {
'If-Modified-Since': cur.timestamp,
} : {};
Expand Down

0 comments on commit b132200

Please sign in to comment.