mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2025-08-05 02:25:45 +02:00
Add:Nav button in side drawer and item more menu to go to web client #1079
This commit is contained in:
parent
f04eebe0d8
commit
3c6d4b5f19
24 changed files with 69 additions and 7 deletions
|
@ -1,3 +1,5 @@
|
|||
import { Browser } from '@capacitor/browser'
|
||||
|
||||
export const state = () => ({
|
||||
user: null,
|
||||
serverConnectionConfig: null,
|
||||
|
@ -115,6 +117,21 @@ export const actions = {
|
|||
commit('setSettings', userSettings)
|
||||
this.$eventBus.$emit('user-settings', state.settings)
|
||||
}
|
||||
},
|
||||
async openWebClient({ getters }, path = null) {
|
||||
const serverAddress = getters.getServerAddress
|
||||
if (!serverAddress) {
|
||||
console.error('openWebClient: No server address')
|
||||
return
|
||||
}
|
||||
try {
|
||||
let url = serverAddress.replace(/\/$/, '') // Remove trailing slash
|
||||
if (path?.startsWith('/')) url += path
|
||||
|
||||
await Browser.open({ url })
|
||||
} catch (error) {
|
||||
console.error('Error opening browser', error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue