bookmarks/src/App.vue

47 lines
1.1 KiB
Vue
Raw Normal View History

2020-09-21 12:25:50 +00:00
<!--
- Copyright (c) 2020. The Nextcloud Bookmarks contributors.
-
- 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>
<router-view />
2019-07-26 18:16:37 +00:00
</template>
<script>
import { mutations } from './store/'
import { showError, showMessage } from '@nextcloud/dialogs'
import { generateFilePath } from '@nextcloud/router'
import { getRequestToken } from '@nextcloud/auth'
2020-09-29 10:48:15 +00:00
import '@nextcloud/dialogs/styles/toast.scss'
// 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() {
return this.$store.state.error
},
notification() {
return this.$store.state.notification
},
2019-08-04 21:49:07 +00:00
},
watch: {
error(error) {
if (!error) return
showError(error)
this.$store.commit(mutations.SET_ERROR, null)
},
notification(notification) {
if (!notification) return
showMessage(notification)
this.$store.commit(mutations.SET_NOTIFICATION, null)
},
},
}
2019-07-26 18:16:37 +00:00
</script>