Check app version, fix close stream bug, show audiobook progress, add toasts

This commit is contained in:
advplyr 2021-09-04 12:31:00 -05:00
parent 98076927ff
commit 619b6f3686
51 changed files with 551 additions and 141 deletions

View file

@ -17,11 +17,15 @@
</svg>
</a>
</div>
<p class="font-mono pt-1 pb-4">v{{ $config.version }}</p>
<p class="font-mono pt-1 pb-4">{{ $config.version }}</p>
<ui-btn v-if="isUpdateAvailable" class="w-full my-4" color="success" @click="clickUpdate"> Version {{ availableVersion }} is available! {{ immediateUpdateAllowed ? 'Update now' : 'Get update from app store' }} </ui-btn>
</div>
</template>
<script>
import { AppUpdate } from '@robingenz/capacitor-app-update'
export default {
data() {
return {}
@ -35,9 +39,32 @@ export default {
},
serverUrl() {
return this.$server.url
},
appUpdateInfo() {
return this.$store.state.appUpdateInfo
},
availableVersion() {
return this.appUpdateInfo ? this.appUpdateInfo.availableVersion : null
},
immediateUpdateAllowed() {
return this.appUpdateInfo ? !!this.appUpdateInfo.immediateUpdateAllowed : false
},
updateAvailability() {
return this.appUpdateInfo ? this.appUpdateInfo.updateAvailability : null
},
isUpdateAvailable() {
return this.updateAvailability === 2
}
},
methods: {
async clickUpdate() {
if (this.immediateUpdateAllowed) {
await AppUpdate.performImmediateUpdate()
} else {
await AppUpdate.openAppStore()
}
}
},
methods: {},
mounted() {}
}
</script>