2020-09-21 12:25:50 +00:00
|
|
|
<!--
|
2024-02-02 18:27:50 +00:00
|
|
|
- Copyright (c) 2020-2024. The Nextcloud Bookmarks contributors.
|
2020-09-21 12:25:50 +00:00
|
|
|
-
|
|
|
|
- This file is licensed under the Affero General Public License version 3 or later. See the COPYING file.
|
|
|
|
-->
|
|
|
|
|
2019-07-26 18:16:37 +00:00
|
|
|
<template>
|
2019-09-24 15:18:29 +00:00
|
|
|
<router-view />
|
2019-07-26 18:16:37 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2022-12-12 19:29:03 +00:00
|
|
|
import { mutations } from './store/index.js'
|
2020-03-28 17:15:59 +00:00
|
|
|
import { showError, showMessage } from '@nextcloud/dialogs'
|
2021-07-24 13:48:34 +00:00
|
|
|
import { generateFilePath } from '@nextcloud/router'
|
|
|
|
import { getRequestToken } from '@nextcloud/auth'
|
2024-02-02 18:18:52 +00:00
|
|
|
import '@nextcloud/dialogs/dist/index.css'
|
2020-03-28 17:15:59 +00:00
|
|
|
|
2021-07-24 13:48:34 +00:00
|
|
|
// eslint-disable-next-line camelcase
|
|
|
|
__webpack_nonce__ = btoa(getRequestToken())
|
|
|
|
// eslint-disable-next-line camelcase
|
|
|
|
__webpack_public_path__ = generateFilePath('bookmarks', '', 'js/')
|
|
|
|
|
2019-07-26 18:16:37 +00:00
|
|
|
export default {
|
2019-08-04 21:49:07 +00:00
|
|
|
name: 'App',
|
|
|
|
computed: {
|
|
|
|
error() {
|
2019-09-24 15:18:29 +00:00
|
|
|
return this.$store.state.error
|
2019-12-10 21:33:54 +00:00
|
|
|
},
|
2020-03-28 17:15:59 +00:00
|
|
|
notification() {
|
|
|
|
return this.$store.state.notification
|
|
|
|
},
|
2019-08-04 21:49:07 +00:00
|
|
|
},
|
|
|
|
watch: {
|
|
|
|
error(error) {
|
2019-09-24 15:18:29 +00:00
|
|
|
if (!error) return
|
2020-03-28 17:15:59 +00:00
|
|
|
showError(error)
|
2019-09-24 15:18:29 +00:00
|
|
|
this.$store.commit(mutations.SET_ERROR, null)
|
2019-12-10 21:33:54 +00:00
|
|
|
},
|
2020-03-28 17:15:59 +00:00
|
|
|
notification(notification) {
|
|
|
|
if (!notification) return
|
|
|
|
showMessage(notification)
|
|
|
|
this.$store.commit(mutations.SET_NOTIFICATION, null)
|
|
|
|
},
|
2019-12-10 21:33:54 +00:00
|
|
|
},
|
2019-09-24 15:18:29 +00:00
|
|
|
}
|
2019-07-26 18:16:37 +00:00
|
|
|
</script>
|