Linux updater: better message
This commit is contained in:
@@ -45,8 +45,6 @@ function checkForUpdates () {
|
||||
if (res.statusCode !== 200) return
|
||||
|
||||
var obj = JSON.parse(data)
|
||||
// TODO: version should be included in the response object, we shouldn'v have to parse obj.name
|
||||
var version = obj.name.slice(obj.name.lastIndexOf('v') + 1)
|
||||
windows.main.send('dispatch', 'updateAvailable', version)
|
||||
windows.main.send('dispatch', 'updateAvailable', obj.version)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -309,7 +309,7 @@ function dispatch (action, ...args) {
|
||||
}
|
||||
|
||||
// Shows a modal saying that we have an update
|
||||
function updateAvailable(version) {
|
||||
function updateAvailable (version) {
|
||||
if (state.saved.skippedVersions && state.saved.skippedVersions.includes(version)) {
|
||||
console.log('new version skipped by user: v' + version)
|
||||
return
|
||||
|
||||
@@ -12,25 +12,21 @@ function UpdateAvailableModal (state) {
|
||||
return hx`
|
||||
<div class='update-available-modal'>
|
||||
<p><strong>A new version of WebTorrent is available: v${state.modal.version}</strong></p>
|
||||
<p>We have an auto-updater for Windows and Mac, but not yet for Linux, so you'll have to download it manually. Sorry.</p>
|
||||
<p>We have an auto-updater for Windows and Mac. We don't have one for Linux yet, so you'll have to download the new version manually.</p>
|
||||
<p>
|
||||
<button class='primary' onclick=${handleOK}>Show Download Page</button>
|
||||
<button class='cancel' onclick=${handleCancel}>Skip This Release</button>
|
||||
</p>
|
||||
</div>
|
||||
`
|
||||
}
|
||||
|
||||
function handleKeyPress (e) {
|
||||
if (e.which === 13) handleOK() /* hit Enter to submit */
|
||||
}
|
||||
function handleOK () {
|
||||
electron.shell.openExternal('https://github.com/feross/webtorrent-desktop/releases')
|
||||
dispatch('exitModal')
|
||||
}
|
||||
|
||||
function handleOK () {
|
||||
electron.shell.openExternal('https://github.com/feross/webtorrent-desktop/releases')
|
||||
dispatch('exitModal')
|
||||
}
|
||||
|
||||
function handleCancel () {
|
||||
dispatch('skipVersion', state.modal.version)
|
||||
dispatch('exitModal')
|
||||
function handleCancel () {
|
||||
dispatch('skipVersion', state.modal.version)
|
||||
dispatch('exitModal')
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user