mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2025-07-15 08:24:50 +02:00
Update:Metered network connections to send progress syncs every 60s instead of every 5s and show metered/unmetered in connection status icon #238
This commit is contained in:
parent
fd134097a1
commit
4c678836fb
6 changed files with 71 additions and 9 deletions
|
@ -24,6 +24,9 @@ export default {
|
|||
networkConnectionType() {
|
||||
return this.$store.state.networkConnectionType
|
||||
},
|
||||
isNetworkUnmetered() {
|
||||
return this.$store.state.isNetworkUnmetered
|
||||
},
|
||||
isCellular() {
|
||||
return this.networkConnectionType === 'cellular'
|
||||
},
|
||||
|
@ -43,6 +46,7 @@ export default {
|
|||
iconClass() {
|
||||
if (!this.networkConnected) return 'text-error'
|
||||
else if (!this.socketConnected) return 'text-warning'
|
||||
else if (!this.isNetworkUnmetered) return 'text-yellow-400'
|
||||
else if (this.isCellular) return 'text-gray-200'
|
||||
else return 'text-success'
|
||||
}
|
||||
|
@ -50,14 +54,15 @@ export default {
|
|||
methods: {
|
||||
showAlertDialog() {
|
||||
var msg = ''
|
||||
var meteredString = this.isNetworkUnmetered ? 'unmetered' : 'metered'
|
||||
if (!this.networkConnected) {
|
||||
msg = 'No internet'
|
||||
} else if (!this.socketConnected) {
|
||||
msg = 'Socket not connected'
|
||||
} else if (this.isCellular) {
|
||||
msg = 'Socket connected over cellular'
|
||||
msg = `Socket connected over ${meteredString} cellular`
|
||||
} else {
|
||||
msg = 'Socket connected over wifi'
|
||||
msg = `Socket connected over ${meteredString} wifi`
|
||||
}
|
||||
Dialog.alert({
|
||||
title: 'Connection Status',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue