formatting, full migration to svelte-french-toast
This commit is contained in:
@@ -5,8 +5,9 @@
|
||||
import { DonorService } from "@odit/lfk-client-js";
|
||||
import isEmail from "validator/es/lib/isEmail";
|
||||
import isMobilePhone from "validator/es/lib/isMobilePhone";
|
||||
import Toastify from "toastify-js";
|
||||
|
||||
import { createEventDispatcher } from "svelte";
|
||||
import toast from "svelte-french-toast";
|
||||
export let modal_open;
|
||||
let firstname_input;
|
||||
let lastname_input;
|
||||
@@ -73,10 +74,7 @@
|
||||
function submit() {
|
||||
if (processed_last_submit === true) {
|
||||
processed_last_submit = false;
|
||||
const toast = Toastify({
|
||||
text: $_("donor-is-being-added"),
|
||||
duration: -1,
|
||||
}).showToast();
|
||||
toast.loading($_("donor-is-being-added"));
|
||||
let address = {};
|
||||
if (address_checked === true) {
|
||||
address = {
|
||||
@@ -110,11 +108,8 @@
|
||||
email_input_value = "";
|
||||
modal_open = false;
|
||||
//
|
||||
Toastify({
|
||||
text: $_("donor-added"),
|
||||
duration: 500,
|
||||
backgroundColor: "linear-gradient(to right, #00b09b, #96c93d)",
|
||||
}).showToast();
|
||||
toast.dismiss();
|
||||
toast.success($_("donor-added"));
|
||||
dispatch("created", { donors: [result] });
|
||||
})
|
||||
.catch((err) => {
|
||||
@@ -122,8 +117,6 @@
|
||||
})
|
||||
.finally(() => {
|
||||
processed_last_submit = true;
|
||||
//
|
||||
toast.hideToast();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user