mirror of
https://github.com/AltarikMC/Launcher
synced 2025-12-16 12:13:50 +00:00
Merge pull request #184 from AltarikMC/fix-updater
Fix updater on linux, should display download text on windows, dump to 2.0.2
This commit is contained in:
@@ -28,7 +28,7 @@ function createWindow () {
|
||||
},
|
||||
frame: false
|
||||
})
|
||||
Menu.setApplicationMenu(null)
|
||||
//Menu.setApplicationMenu(null)
|
||||
win.loadFile('src/client/checkingUpdate.html')
|
||||
win.on("close", () => {
|
||||
app.quit()
|
||||
|
||||
@@ -67,16 +67,19 @@ class Updater {
|
||||
if(response.status === 200) {
|
||||
response.json().then(json => {
|
||||
if(json.tag_name !== pkg.version) {
|
||||
let asset = json.assets.filter(el => el.browser_download_url.inludes(".zip"))
|
||||
if(asset.length ===1) {
|
||||
let asset = json.assets.filter(el => el.browser_download_url.includes(".zip"))
|
||||
if(asset.length === 1) {
|
||||
let downloadUrl = asset[0].browser_download_url
|
||||
win.webContents.send("please-download-update", { url: downloadUrl} )
|
||||
this.logger.info("update available, please download")
|
||||
} else {
|
||||
this.displayError(win, showNotification, "Can't find right asset in last update")
|
||||
}
|
||||
} else {
|
||||
this.logger.info("update not available")
|
||||
win.loadFile('src/client/login.html')
|
||||
}
|
||||
}).catch(err => this.displayError(win, showNotification, err)
|
||||
)
|
||||
}).catch(err => this.displayError(win, showNotification, err))
|
||||
} else {
|
||||
this.displayError(win, showNotification, "Server unavailable")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user