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