2021-04-11 21:17:23 -07:00
|
|
|
import useMangoStore from '../stores/useMangoStore'
|
|
|
|
|
|
|
|
export function notify(newNotification: {
|
|
|
|
type?: string
|
|
|
|
message: string
|
|
|
|
description?: string
|
|
|
|
txid?: string
|
|
|
|
}) {
|
|
|
|
const setMangoStore = useMangoStore.getState().set
|
2021-04-12 13:01:55 -07:00
|
|
|
const notifications = useMangoStore.getState().notifications
|
2021-04-11 21:17:23 -07:00
|
|
|
|
|
|
|
setMangoStore((state) => {
|
|
|
|
state.notifications = [
|
2021-04-12 13:01:55 -07:00
|
|
|
...notifications,
|
2021-04-11 21:17:23 -07:00
|
|
|
{ type: 'success', ...newNotification },
|
|
|
|
]
|
|
|
|
})
|
2021-04-02 11:26:21 -07:00
|
|
|
}
|