aboutsummaryrefslogtreecommitdiff
path: root/src/site/layouts/default.vue
diff options
context:
space:
mode:
authorZephyrrus <[email protected]>2020-07-09 02:21:35 +0300
committerZephyrrus <[email protected]>2020-07-09 02:21:35 +0300
commit495a23c3a53b8f1e9f885163129d962cbd3e8c2b (patch)
tree87c534d4221f0a5f00536044a6300de8accf6757 /src/site/layouts/default.vue
parentchore: add unique integrity checks to the database for many-to-many tables (diff)
downloadhost.fuwn.me-495a23c3a53b8f1e9f885163129d962cbd3e8c2b.tar.xz
host.fuwn.me-495a23c3a53b8f1e9f885163129d962cbd3e8c2b.zip
feat: add notifier plugin for 🐍 and 🍞
Diffstat (limited to 'src/site/layouts/default.vue')
-rw-r--r--src/site/layouts/default.vue29
1 files changed, 19 insertions, 10 deletions
diff --git a/src/site/layouts/default.vue b/src/site/layouts/default.vue
index 13a56c0..0049b88 100644
--- a/src/site/layouts/default.vue
+++ b/src/site/layouts/default.vue
@@ -21,19 +21,28 @@ export default {
Navbar,
Footer,
},
- computed: mapState(['config']),
+ computed: mapState(['config', 'alert']),
created() {
- this.$store.watch((state) => state.alert.text, () => {
- const { text, error } = this.$store.state.alert;
+ this.$store.watch((state) => state.alert.message, () => {
+ const { message, type, snackbar } = this.alert;
- if (!text) return;
+ if (!message) return;
- this.$buefy.toast.open({
- duration: 3500,
- message: text,
- position: 'is-bottom',
- type: error ? 'is-danger' : 'is-success',
- });
+ if (snackbar) {
+ this.$buefy.snackbar.open({
+ duration: 3500,
+ position: 'is-bottom',
+ message,
+ type,
+ });
+ } else {
+ this.$buefy.toast.open({
+ duration: 3500,
+ position: 'is-bottom',
+ message,
+ type,
+ });
+ }
this.$store.dispatch('alert/clear', null);
});