Added changelog button

This commit is contained in:
Kylart 2019-07-20 12:58:25 +02:00
parent 0dfd766904
commit fb2a613659
2 changed files with 20 additions and 4 deletions

View File

@ -15,8 +15,15 @@
searcher
downloader
settings
// v-btn(icon, @click='toggleRightDrawer')
// v-icon chevron_left
v-tooltip(top)
v-btn(
@click='openChangelog',
slot='activator',
icon
)
v-icon fiber_new
span What's new in version v{{ version }}?
</template>
<script>
@ -30,6 +37,11 @@ export default {
components: { Settings, Searcher, Downloader },
data: () => ({
version: process.env.VUE_APP_KAWANIME_VERSION,
changelogLink: `https://github.com/Kylart/KawAnime/releases/tag/v${process.env.VUE_APP_KAWANIME_VERSION}`
}),
computed: {
update: {
get () {
@ -54,6 +66,9 @@ export default {
},
restartAndUpdate () {
this.$store.dispatch('update/updateApp')
},
openChangelog () {
this.$electron.shell.openExternal(this.changelogLink)
}
}
}

View File

@ -1,8 +1,6 @@
const fs = require('fs')
const path = require('path')
process.env.KAWANIME_VERSION = JSON.parse(fs.readFileSync(path.resolve(__dirname, 'package.json'))).version
/**
* Taken from https://gist.github.com/kethinov/6658166#gistcomment-2389484
*
@ -18,8 +16,11 @@ const getAllFiles = (dir) =>
return isDirectory ? [...files, ...getAllFiles(name)] : [...files, name]
}, [])
const VERSION = JSON.parse(fs.readFileSync(path.resolve(__dirname, 'package.json'))).version
const VENDOR_PATH = path.join(__dirname, 'src', 'vendor')
process.env.VUE_APP_KAWANIME_VERSION = VERSION
module.exports = {
configureWebpack: {
devtool: 'source-map',