mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-04-14 00:34:05 +00:00
28 lines
708 B
JavaScript
28 lines
708 B
JavaScript
import * as types from './mutation-types'
|
|
|
|
export const showNotification = ({ commit, dispatch, state }, payload) => {
|
|
commit(types.SHOW_NOTIFICATION, true)
|
|
|
|
if (payload.type) {
|
|
commit(types.SET_NOTIFICATION_TYPE, payload.type)
|
|
}
|
|
if (payload.title) {
|
|
commit(types.SET_TITLE, payload.title)
|
|
}
|
|
if (payload.autoHide) {
|
|
commit(types.SET_AUTO_HIDE, payload.autoHide)
|
|
}
|
|
if (payload.message) {
|
|
commit(types.SET_MESSAGE, payload.message)
|
|
}
|
|
}
|
|
|
|
export const hideNotification = ({ commit, dispatch, state }) => {
|
|
commit(types.RESET_DATA)
|
|
commit(types.HIDE_NOTIFICATION, false)
|
|
}
|
|
|
|
export const resetNotificationData = ({ commit, dispatch, state }) => {
|
|
commit(types.RESET_DATA)
|
|
}
|