fix updateNotice, show current/latest version
This commit is contained in:
parent
01655d2c00
commit
fa726b85a8
2 changed files with 6 additions and 1 deletions
2
index.js
2
index.js
|
@ -94,7 +94,7 @@ app.listen(config.port, () => logger.success('express', `Express server started
|
|||
try {
|
||||
const res = await fetch('https://raw.githubusercontent.com/Wingysam/Christmas-Community/master/package.json')
|
||||
const data = await res.json()
|
||||
_CC.updateNotice = data.version === _CC.package.version
|
||||
_CC.updateNotice = (data.version === _CC.package.version) ? false : { current: _CC.package.version, latest: data.version }
|
||||
} catch (_) {}
|
||||
}
|
||||
checkUpdates()
|
||||
|
|
|
@ -49,4 +49,9 @@ html(lang='en')
|
|||
span.has-text-danger.is-size-4.has-text-weight-bold Christmas Community is out of date. There may be new features or bug fixes. Consider updating! :)
|
||||
br
|
||||
span (you can turn this off with <code>UPDATE_CHECK=false</code>)
|
||||
br
|
||||
br
|
||||
span Current: #{_CC.updateNotice.current}
|
||||
br
|
||||
span Latest: #{_CC.updateNotice.latest}
|
||||
span.has-text-info(style='float: right;') This message is only visible to admins
|
Loading…
Reference in a new issue