mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-18 08:12:15 +00:00
notification implementation into the toaster
This commit is contained in:
3
resources/js/store/modules/app.js
vendored
3
resources/js/store/modules/app.js
vendored
@@ -175,6 +175,9 @@ const mutations = {
|
||||
TOGGLE_NOTIFICATION_CENTER(state) {
|
||||
state.isVisibleNotificationCenter = !state.isVisibleNotificationCenter
|
||||
},
|
||||
CLOSE_NOTIFICATION_CENTER(state) {
|
||||
state.isVisibleNotificationCenter = false
|
||||
},
|
||||
}
|
||||
|
||||
const getters = {
|
||||
|
||||
24
resources/js/store/modules/broadcasting.js
vendored
24
resources/js/store/modules/broadcasting.js
vendored
@@ -1,3 +1,5 @@
|
||||
import {events} from "../../bus";
|
||||
|
||||
const defaultState = {
|
||||
isRunningConnection: false,
|
||||
}
|
||||
@@ -8,8 +10,26 @@ const actions = {
|
||||
commit('SET_RUNNING_COMMUNICATION')
|
||||
|
||||
Echo.private(`App.Users.Models.User.${getters.user.data.id}`)
|
||||
.notification(() => {
|
||||
// TODO: call sound
|
||||
.notification((notification) => {
|
||||
|
||||
// Play audio
|
||||
new Audio('/audio/blop.wav').play();
|
||||
|
||||
// Call toaster notification
|
||||
events.$emit('notification', {
|
||||
data: {
|
||||
type: notification.category,
|
||||
id: notification.id,
|
||||
attributes: {
|
||||
action: notification.action,
|
||||
description: notification.description,
|
||||
title: notification.title,
|
||||
category: notification.category,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
// Reload user data to update notifications
|
||||
dispatch('getAppData')
|
||||
});
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user