Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function sendAlertWithVariables(message: string, variables: object, options: object = {}) {
const defaults: SnackbarConfig = {
message: VueI18n.t(message, variables) as string,
type: 'is-danger',
position: 'is-bottom-right',
queue: false
}
SnackbarProgrammatic.open({...defaults, ...options} as SnackbarConfig)
}
export function sendAlertWithVariables(message: string, variables: object, options: object = {}) {
const defaults: SnackbarConfig = {
message: VueI18n.t(message, variables) as string,
type: 'is-danger',
position: 'is-bottom-right',
queue: false
}
SnackbarProgrammatic.open({...defaults, ...options} as SnackbarConfig)
}
}, function (error) {
if (error.response.data.message === 'The CSRF token has expired') {
Snackbar.open({
message: error.response.data.message,
type: 'is-white',
position: 'is-top',
actionText: 'Refresh',
indefinite: true,
onAction: () => {
location.reload()
}}
)
} else {
Toast.open(error.response.data.message)
}
return Promise.reject(error);
});
export function snackbar(message, opts) {
var type = message.toLowerCase().includes('error') ? 'is-danger' : 'is-success';
Snackbar.open(Object.assign({
duration: 300000,
message: message,
position: 'is-top-right',
type: type,
}, opts));
}
export function snackbar(message, opts) {
var type = message.toLowerCase().includes('error') ? 'is-danger' : 'is-success';
Snackbar.open(Object.assign({
duration: 300000,
message: message,
position: 'is-top-right',
type: type,
}, opts));
}