Remove app update package

This commit is contained in:
advplyr 2022-05-07 17:32:18 -05:00
parent aecb6a8dd2
commit e8b6602fe5
9 changed files with 18768 additions and 131 deletions

View file

@ -15,7 +15,6 @@ dependencies {
implementation project(':capacitor-network') implementation project(':capacitor-network')
implementation project(':capacitor-status-bar') implementation project(':capacitor-status-bar')
implementation project(':capacitor-storage') implementation project(':capacitor-storage')
implementation project(':robingenz-capacitor-app-update')
} }

View file

@ -22,9 +22,5 @@
{ {
"pkg": "@capacitor/storage", "pkg": "@capacitor/storage",
"classpath": "com.capacitorjs.plugins.storage.StoragePlugin" "classpath": "com.capacitorjs.plugins.storage.StoragePlugin"
},
{
"pkg": "@robingenz/capacitor-app-update",
"classpath": "dev.robingenz.capacitor.appupdate.AppUpdatePlugin"
} }
] ]

View file

@ -19,6 +19,3 @@ project(':capacitor-status-bar').projectDir = new File('../node_modules/@capacit
include ':capacitor-storage' include ':capacitor-storage'
project(':capacitor-storage').projectDir = new File('../node_modules/@capacitor/storage/android') 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')

View file

@ -15,7 +15,6 @@ def capacitor_pods
pod 'CapacitorNetwork', :path => '..\..\node_modules\@capacitor\network' pod 'CapacitorNetwork', :path => '..\..\node_modules\@capacitor\network'
pod 'CapacitorStatusBar', :path => '..\..\node_modules\@capacitor\status-bar' pod 'CapacitorStatusBar', :path => '..\..\node_modules\@capacitor\status-bar'
pod 'CapacitorStorage', :path => '..\..\node_modules\@capacitor\storage' pod 'CapacitorStorage', :path => '..\..\node_modules\@capacitor\storage'
pod 'RobingenzCapacitorAppUpdate', :path => '..\..\node_modules\@robingenz\capacitor-app-update'
end end
target 'App' do target 'App' do

View file

@ -12,8 +12,6 @@
</template> </template>
<script> <script>
import { AppUpdate } from '@robingenz/capacitor-app-update'
export default { export default {
data() { data() {
return { return {
@ -79,36 +77,6 @@ export default {
this.$refs.streamContainer.streamOpen(stream) 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() { async loadSavedSettings() {
var userSavedServerSettings = await this.$localStore.getServerSettings() var userSavedServerSettings = await this.$localStore.getServerSettings()
if (userSavedServerSettings) { if (userSavedServerSettings) {
@ -255,7 +223,6 @@ export default {
console.log(`[default] finished connection attempt or already connected ${!!this.user}`) console.log(`[default] finished connection attempt or already connected ${!!this.user}`)
await this.syncLocalMediaProgress() await this.syncLocalMediaProgress()
this.$store.dispatch('globals/loadLocalMediaProgress') this.$store.dispatch('globals/loadLocalMediaProgress')
this.checkForUpdate()
this.loadSavedSettings() this.loadSavedSettings()
this.hasMounted = true this.hasMounted = true
} }

18813
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -23,7 +23,6 @@
"@capacitor/status-bar": "^1.0.8", "@capacitor/status-bar": "^1.0.8",
"@capacitor/storage": "^1.2.5", "@capacitor/storage": "^1.2.5",
"@nuxtjs/axios": "^5.13.6", "@nuxtjs/axios": "^5.13.6",
"@robingenz/capacitor-app-update": "^1.3.1",
"core-js": "^3.15.1", "core-js": "^3.15.1",
"date-fns": "^2.25.0", "date-fns": "^2.25.0",
"epubjs": "^0.3.88", "epubjs": "^0.3.88",
@ -39,4 +38,4 @@
"@nuxtjs/tailwindcss": "^4.2.0", "@nuxtjs/tailwindcss": "^4.2.0",
"postcss": "^8.3.5" "postcss": "^8.3.5"
} }
} }

View file

@ -19,19 +19,10 @@
</div> </div>
<p class="font-mono pt-1 pb-4">{{ $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">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> </div>
</template> </template>
<script> <script>
import { AppUpdate } from '@robingenz/capacitor-app-update'
import { AbsAudioPlayer } from '@/plugins/capacitor'
export default { export default {
asyncData({ redirect, store }) { asyncData({ redirect, store }) {
if (!store.state.socketConnected) { if (!store.state.socketConnected) {
@ -58,24 +49,6 @@ export default {
}, },
serverAddress() { serverAddress() {
return this.serverConnectionConfig.address 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: { methods: {
@ -85,16 +58,6 @@ export default {
}) })
this.$server.logout() this.$server.logout()
this.$router.push('/connect') this.$router.push('/connect')
},
openAppStore() {
AppUpdate.openAppStore()
},
async clickUpdate() {
if (this.immediateUpdateAllowed) {
AppUpdate.performImmediateUpdate()
} else {
AppUpdate.openAppStore()
}
} }
}, },
mounted() {} mounted() {}

View file

@ -7,7 +7,6 @@ export const state = () => ({
playerIsPlaying: false, playerIsPlaying: false,
isCasting: false, isCasting: false,
isCastAvailable: false, isCastAvailable: false,
appUpdateInfo: null,
socketConnected: false, socketConnected: false,
networkConnected: false, networkConnected: false,
networkConnectionType: null, networkConnectionType: null,
@ -84,9 +83,6 @@ export const mutations = {
setIsFirstLoad(state, val) { setIsFirstLoad(state, val) {
state.isFirstLoad = val state.isFirstLoad = val
}, },
setAppUpdateInfo(state, info) {
state.appUpdateInfo = info
},
setSocketConnected(state, val) { setSocketConnected(state, val) {
state.socketConnected = val state.socketConnected = val
}, },