mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2025-08-18 00:28:36 +02:00
Remove app update package
This commit is contained in:
parent
aecb6a8dd2
commit
e8b6602fe5
9 changed files with 18768 additions and 131 deletions
|
@ -15,7 +15,6 @@ dependencies {
|
|||
implementation project(':capacitor-network')
|
||||
implementation project(':capacitor-status-bar')
|
||||
implementation project(':capacitor-storage')
|
||||
implementation project(':robingenz-capacitor-app-update')
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -22,9 +22,5 @@
|
|||
{
|
||||
"pkg": "@capacitor/storage",
|
||||
"classpath": "com.capacitorjs.plugins.storage.StoragePlugin"
|
||||
},
|
||||
{
|
||||
"pkg": "@robingenz/capacitor-app-update",
|
||||
"classpath": "dev.robingenz.capacitor.appupdate.AppUpdatePlugin"
|
||||
}
|
||||
]
|
||||
|
|
|
@ -19,6 +19,3 @@ project(':capacitor-status-bar').projectDir = new File('../node_modules/@capacit
|
|||
|
||||
include ':capacitor-storage'
|
||||
project(':capacitor-storage').projectDir = new File('../node_modules/@capacitor/storage/android')
|
||||
|
||||
include ':robingenz-capacitor-app-update'
|
||||
project(':robingenz-capacitor-app-update').projectDir = new File('../node_modules/@robingenz/capacitor-app-update/android')
|
||||
|
|
|
@ -15,7 +15,6 @@ def capacitor_pods
|
|||
pod 'CapacitorNetwork', :path => '..\..\node_modules\@capacitor\network'
|
||||
pod 'CapacitorStatusBar', :path => '..\..\node_modules\@capacitor\status-bar'
|
||||
pod 'CapacitorStorage', :path => '..\..\node_modules\@capacitor\storage'
|
||||
pod 'RobingenzCapacitorAppUpdate', :path => '..\..\node_modules\@robingenz\capacitor-app-update'
|
||||
end
|
||||
|
||||
target 'App' do
|
||||
|
|
|
@ -12,8 +12,6 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { AppUpdate } from '@robingenz/capacitor-app-update'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -79,36 +77,6 @@ export default {
|
|||
this.$refs.streamContainer.streamOpen(stream)
|
||||
}
|
||||
},
|
||||
async clickUpdateToast() {
|
||||
var immediateUpdateAllowed = this.$store.state.appUpdateInfo.immediateUpdateAllowed
|
||||
if (immediateUpdateAllowed) {
|
||||
await AppUpdate.performImmediateUpdate()
|
||||
} else {
|
||||
await AppUpdate.openAppStore()
|
||||
}
|
||||
},
|
||||
async checkForUpdate() {
|
||||
if (this.$platform == 'web') return
|
||||
console.log('Checking for app update')
|
||||
const result = await AppUpdate.getAppUpdateInfo()
|
||||
if (!result) {
|
||||
console.error('Invalid version check')
|
||||
return
|
||||
}
|
||||
console.log('App Update Info', JSON.stringify(result))
|
||||
this.$store.commit('setAppUpdateInfo', result)
|
||||
if (result.updateAvailability === 2) {
|
||||
setTimeout(() => {
|
||||
this.$toast.info(`Update is available! Click to update.`, {
|
||||
draggable: false,
|
||||
hideProgressBar: false,
|
||||
timeout: 20000,
|
||||
closeButton: true,
|
||||
onClick: this.clickUpdateToast
|
||||
})
|
||||
}, 5000)
|
||||
}
|
||||
},
|
||||
async loadSavedSettings() {
|
||||
var userSavedServerSettings = await this.$localStore.getServerSettings()
|
||||
if (userSavedServerSettings) {
|
||||
|
@ -255,7 +223,6 @@ export default {
|
|||
console.log(`[default] finished connection attempt or already connected ${!!this.user}`)
|
||||
await this.syncLocalMediaProgress()
|
||||
this.$store.dispatch('globals/loadLocalMediaProgress')
|
||||
this.checkForUpdate()
|
||||
this.loadSavedSettings()
|
||||
this.hasMounted = true
|
||||
}
|
||||
|
|
18811
package-lock.json
generated
18811
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -23,7 +23,6 @@
|
|||
"@capacitor/status-bar": "^1.0.8",
|
||||
"@capacitor/storage": "^1.2.5",
|
||||
"@nuxtjs/axios": "^5.13.6",
|
||||
"@robingenz/capacitor-app-update": "^1.3.1",
|
||||
"core-js": "^3.15.1",
|
||||
"date-fns": "^2.25.0",
|
||||
"epubjs": "^0.3.88",
|
||||
|
|
|
@ -19,19 +19,10 @@
|
|||
</div>
|
||||
|
||||
<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">Update is available</ui-btn>
|
||||
|
||||
<ui-btn v-if="!isUpdateAvailable || immediateUpdateAllowed" class="w-full my-4" color="primary" @click="openAppStore">Open app store</ui-btn>
|
||||
|
||||
<p class="text-xs text-gray-400">UA: {{ updateAvailability }} | Avail: {{ availableVersion }} | Curr: {{ currentVersion }} | ImmedAllowed: {{ immediateUpdateAllowed }}</p>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { AppUpdate } from '@robingenz/capacitor-app-update'
|
||||
import { AbsAudioPlayer } from '@/plugins/capacitor'
|
||||
|
||||
export default {
|
||||
asyncData({ redirect, store }) {
|
||||
if (!store.state.socketConnected) {
|
||||
|
@ -58,24 +49,6 @@ export default {
|
|||
},
|
||||
serverAddress() {
|
||||
return this.serverConnectionConfig.address
|
||||
},
|
||||
appUpdateInfo() {
|
||||
return this.$store.state.appUpdateInfo
|
||||
},
|
||||
availableVersion() {
|
||||
return this.appUpdateInfo ? this.appUpdateInfo.availableVersion : null
|
||||
},
|
||||
currentVersion() {
|
||||
return this.appUpdateInfo ? this.appUpdateInfo.currentVersion : null
|
||||
},
|
||||
immediateUpdateAllowed() {
|
||||
return this.appUpdateInfo ? !!this.appUpdateInfo.immediateUpdateAllowed : false
|
||||
},
|
||||
updateAvailability() {
|
||||
return this.appUpdateInfo ? this.appUpdateInfo.updateAvailability : null
|
||||
},
|
||||
isUpdateAvailable() {
|
||||
return this.updateAvailability === 2
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
@ -85,16 +58,6 @@ export default {
|
|||
})
|
||||
this.$server.logout()
|
||||
this.$router.push('/connect')
|
||||
},
|
||||
openAppStore() {
|
||||
AppUpdate.openAppStore()
|
||||
},
|
||||
async clickUpdate() {
|
||||
if (this.immediateUpdateAllowed) {
|
||||
AppUpdate.performImmediateUpdate()
|
||||
} else {
|
||||
AppUpdate.openAppStore()
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {}
|
||||
|
|
|
@ -7,7 +7,6 @@ export const state = () => ({
|
|||
playerIsPlaying: false,
|
||||
isCasting: false,
|
||||
isCastAvailable: false,
|
||||
appUpdateInfo: null,
|
||||
socketConnected: false,
|
||||
networkConnected: false,
|
||||
networkConnectionType: null,
|
||||
|
@ -84,9 +83,6 @@ export const mutations = {
|
|||
setIsFirstLoad(state, val) {
|
||||
state.isFirstLoad = val
|
||||
},
|
||||
setAppUpdateInfo(state, info) {
|
||||
state.appUpdateInfo = info
|
||||
},
|
||||
setSocketConnected(state, val) {
|
||||
state.socketConnected = val
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue