1
0
Files
AstralRinth/apps/app-frontend/src/store/error.js
Geometrically 157c27c20d Fix forge 1.15.2->1.16.5, Fabric 0.16.0+, and migration issues with Forge (#2232)
* Fix Forge versions, newer fabric, migration breakage

* lint

* fix lint
2024-08-21 21:24:35 -07:00

22 lines
485 B
JavaScript

import { defineStore } from 'pinia'
export const useError = defineStore('errorsStore', {
state: () => ({
errorModal: null,
}),
actions: {
setErrorModal(ref) {
this.errorModal = ref
},
showError(error, context, closable = true, source = null) {
this.errorModal.show(error, context, closable, source)
},
},
})
export const handleSevereError = (err, context) => {
const error = useError()
error.showError(err, context)
console.error(err)
}