diff options
author | Georg Ehrke <developer@georgehrke.com> | 2020-04-17 11:24:56 +0300 |
---|---|---|
committer | Georg Ehrke <developer@georgehrke.com> | 2020-04-20 10:19:00 +0300 |
commit | bc07cb30f759230648edfedd582763fa3a74e83e (patch) | |
tree | 05bc1813dfd71fb3b90ee8e2f442f178c06378fe /src | |
parent | c0615e3a55885e341bb82e2f8fdb3b2f8e6f49c9 (diff) |
Use nc/dialogs instead of OCP.Toast
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/components/Admins.vue | 7 | ||||
-rw-r--r-- | src/components/Encryption.vue | 3 | ||||
-rw-r--r-- | src/components/Location.vue | 3 | ||||
-rw-r--r-- | src/components/Shares.vue | 3 | ||||
-rw-r--r-- | src/main.js | 4 |
5 files changed, 12 insertions, 8 deletions
diff --git a/src/components/Admins.vue b/src/components/Admins.vue index 0765dcb..0c00657 100644 --- a/src/components/Admins.vue +++ b/src/components/Admins.vue @@ -64,6 +64,7 @@ import Vue from 'vue' import ClickOutside from 'vue-click-outside' import HttpClient from '@nextcloud/axios' import { generateUrl } from '@nextcloud/router' +import { showError } from '@nextcloud/dialogs' import Actions from '@nextcloud/vue/dist/Components/Actions' import ActionButton from '@nextcloud/vue/dist/Components/ActionButton' import Avatar from '@nextcloud/vue/dist/Components/Avatar' @@ -99,7 +100,7 @@ export default { Vue.set(this, 'admins', resp.data) } catch (error) { console.error(error) - this.$toast('Error loading additional administrator.') + showError('Error loading additional administrator.') } finally { this.isLoading = false } @@ -132,7 +133,7 @@ export default { this.admins.push(response.data) } catch (error) { console.error(error) - this.$toast('Error adding new administrator.') + showError('Error adding new administrator.') } finally { this.isSavingChanges = false this.isAdding = false @@ -157,7 +158,7 @@ export default { } } catch (error) { console.error(error) - this.$toast('Error deleting new administrator.') + showError('Error deleting new administrator.') } }, }, diff --git a/src/components/Encryption.vue b/src/components/Encryption.vue index ec6d8f5..7500227 100644 --- a/src/components/Encryption.vue +++ b/src/components/Encryption.vue @@ -51,6 +51,7 @@ import { generateUrl } from '@nextcloud/router' import Actions from '@nextcloud/vue/dist/Components/Actions' import ActionButton from '@nextcloud/vue/dist/Components/ActionButton' import { loadState } from '@nextcloud/initial-state' +import { showError } from '@nextcloud/dialogs' export default { name: 'Encryption', @@ -123,7 +124,7 @@ export default { await HttpClient.post(url, { enabled: this.fullDiskEncryptionEnabled ? '1' : '0' }) } catch (error) { console.error(error) - this.$toast('Error saving new state of full-disk-encryption') + showError('Error saving new state of full-disk-encryption') // Reset state this.fullDiskEncryptionEnabled = !this.fullDiskEncryptionEnabled diff --git a/src/components/Location.vue b/src/components/Location.vue index 17fb131..1b02bc3 100644 --- a/src/components/Location.vue +++ b/src/components/Location.vue @@ -52,6 +52,7 @@ import Multiselect from '@nextcloud/vue/dist/Components/Multiselect' import Actions from '@nextcloud/vue/dist/Components/Actions' import ActionButton from '@nextcloud/vue/dist/Components/ActionButton' import { loadState } from '@nextcloud/initial-state' +import { showError } from '@nextcloud/dialogs' import { getCountryList, @@ -136,7 +137,7 @@ export default { this.selectedCountry = value.code } catch (error) { console.error(error) - this.$toast('Error saving new location of the server') + showError('Error saving new location of the server') } finally { this.isEditingLocation = false this.isSavingChanges = false diff --git a/src/components/Shares.vue b/src/components/Shares.vue index b0079c6..af7ccec 100644 --- a/src/components/Shares.vue +++ b/src/components/Shares.vue @@ -39,6 +39,7 @@ import Vue from 'vue' import HttpClient from '@nextcloud/axios' import { generateOcsUrl } from '@nextcloud/router' import { getCurrentUser } from '@nextcloud/auth' +import { showError } from '@nextcloud/dialogs' import Avatar from '@nextcloud/vue/dist/Components/Avatar' export default { @@ -92,7 +93,7 @@ export default { }) } catch (error) { console.error(error) - this.$toast('Error loading information about shares.') + showError('Error loading information about shares.') } finally { this.isLoading = false } diff --git a/src/main.js b/src/main.js index 3602517..9498a9c 100644 --- a/src/main.js +++ b/src/main.js @@ -22,6 +22,7 @@ import 'core-js/stable' import Vue from 'vue' import { linkTo } from '@nextcloud/router' import { translate, translatePlural } from '@nextcloud/l10n' +import { getRequestToken } from '@nextcloud/auth' const Admins = () => import('./components/Admins.vue') const Location = () => import('./components/Location.vue') @@ -30,7 +31,7 @@ const Shares = () => import('./components/Shares.vue') // CSP config for webpack dynamic chunk loading // eslint-disable-next-line -__webpack_nonce__ = btoa(OC.requestToken) +__webpack_nonce__ = btoa(getRequestToken()) // Correct the root of the app for chunk loading // OC.linkTo matches the apps folders @@ -42,7 +43,6 @@ __webpack_public_path__ = linkTo('privacy', 'js/') Vue.prototype.$t = translate Vue.prototype.$n = translatePlural Vue.prototype.$is_admin = OC.isUserAdmin() -Vue.prototype.$toast = OCP.Toast // eslint-disable-line no-undef // The nextcloud-vue package does currently rely on t and n Vue.prototype.t = translate |