Koha/koha-tmpl/intranet-tmpl/prog/js/vue/messages.js
Jonathan Druart daeccd0b8c
Bug 32925: Use a new state for this message
The previous patch didn't work, there is a validation step that make the
form non-accessible after it's greyed out.

This patch is using a new state is_submitting, like the other messages.

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-02-27 11:14:10 -03:00

34 lines
No EOL
960 B
JavaScript

import { useMainStore } from "./stores/main";
export const setError = function (new_error) {
const mainStore = useMainStore();
const { setError } = mainStore;
setError("Something went wrong: " + new_error);
};
export const setWarning = function (new_warning) {
const mainStore = useMainStore();
const { setWarning } = mainStore;
setWarning(new_warning);
};
export const setMessage = function (message) {
const mainStore = useMainStore();
const { setMessage } = mainStore;
setMessage(message);
};
export const removeMessages = function () {
const mainStore = useMainStore();
const { removeMessages } = mainStore;
removeMessages();
};
export const isSubmitting = function () {
const mainStore = useMainStore();
const { isSubmitting } = mainStore;
isSubmitting();
};
export const submitted = function () {
const mainStore = useMainStore();
const { submitted } = mainStore;
submitted();
};