mirror of
https://github.com/ragestudio/relic.git
synced 2025-06-09 10:34:18 +00:00
improve update check indicator
This commit is contained in:
parent
e528a854bb
commit
b772dd12f7
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "rs-bundler",
|
||||
"version": "0.11.0",
|
||||
"version": "0.11.1",
|
||||
"description": "RageStudio Bundler Utility GUI",
|
||||
"main": "./out/main/index.js",
|
||||
"author": "RageStudio",
|
||||
|
@ -264,18 +264,21 @@ class ElectronApp {
|
||||
if (!isDev) {
|
||||
autoUpdater.on("update-available", (ev, info) => {
|
||||
console.log(info)
|
||||
sendToRender("app:checking_update_downloading", info)
|
||||
})
|
||||
|
||||
autoUpdater.on("error", (ev, err) => {
|
||||
console.error(err)
|
||||
sendToRender("app:checking_update_error")
|
||||
})
|
||||
|
||||
autoUpdater.on("update-downloaded", (ev, info) => {
|
||||
console.log(info)
|
||||
|
||||
sendToRender("app:update_available", info)
|
||||
})
|
||||
|
||||
sendToRender("app:checking_update")
|
||||
|
||||
await autoUpdater.checkForUpdates()
|
||||
}
|
||||
}
|
||||
|
@ -52,7 +52,9 @@ class App extends React.Component {
|
||||
loading: true,
|
||||
pkg: null,
|
||||
initializing: false,
|
||||
|
||||
updateAvailable: false,
|
||||
updateText: null,
|
||||
|
||||
authorizedServices: {
|
||||
drive: false,
|
||||
@ -110,7 +112,22 @@ class App extends React.Component {
|
||||
})
|
||||
|
||||
message.success("Google Drive API unauthorized")
|
||||
}
|
||||
},
|
||||
"app:checking_update_downloading": (event, data) => {
|
||||
this.setState({
|
||||
updateText: "Downloading update..."
|
||||
})
|
||||
},
|
||||
"app:checking_update": (event, data) => {
|
||||
this.setState({
|
||||
updateText: "Checking for updates..."
|
||||
})
|
||||
},
|
||||
"app:checking_update_error": (event, data) => {
|
||||
this.setState({
|
||||
updateText: null
|
||||
})
|
||||
},
|
||||
}
|
||||
|
||||
onUpdateAvailable = () => {
|
||||
|
@ -24,6 +24,16 @@ const Header = (props) => {
|
||||
/>
|
||||
}
|
||||
|
||||
{
|
||||
ctx.updateText && <antd.Button
|
||||
size="small"
|
||||
icon={<Icons.MdRefresh />}
|
||||
disabled
|
||||
>
|
||||
{ctx.updateText}
|
||||
</antd.Button>
|
||||
}
|
||||
|
||||
{
|
||||
ctx.updateAvailable && <antd.Button
|
||||
size="small"
|
||||
|
Loading…
x
Reference in New Issue
Block a user