formatting, full migration to svelte-french-toast

This commit is contained in:
2023-04-26 22:47:42 +02:00
parent 38a665024e
commit 46d076af9d
137 changed files with 11984 additions and 9212 deletions

View File

@@ -8,9 +8,8 @@
RunnerService,
} from "@odit/lfk-client-js";
import Select from "svelte-select";
import Toastify from "toastify-js";
import { is_promise } from "svelte/internal";
import { createEventDispatcher } from "svelte";
import toast from "svelte-french-toast";
export let modal_open;
const dispatch = createEventDispatcher();
const getDonorLabel = (option) =>
@@ -18,9 +17,6 @@
const filterDonors = (label, filterText, option) =>
label.toLowerCase().includes(filterText.toLowerCase()) ||
option.value.id.toString().startsWith(filterText.toLowerCase());
function focus(el) {
el.focus();
}
$: donor = 0;
$: runner = 0;
$: donors = [];
@@ -59,10 +55,7 @@
if (processed_last_submit === true) {
let amount_cent = Math.floor(amount_input * 100);
processed_last_submit = false;
const toast = Toastify({
text: $_("adding-donation"),
duration: -1,
}).showToast();
toast.loading($_("adding-donation"));
if (is_fixed) {
let postdata = {
donor,
@@ -79,11 +72,8 @@
amount_input = 0;
modal_open = false;
//
Toastify({
text: $_("donation_added"),
duration: 500,
backgroundColor: "linear-gradient(to right, #00b09b, #96c93d)",
}).showToast();
toast.dismiss();
toast.success($_("donation_added"));
dispatch("created", { donations: [result] });
})
.catch((err) => {
@@ -91,8 +81,6 @@
})
.finally(() => {
processed_last_submit = true;
//
toast.hideToast();
});
} else {
let postdata = {
@@ -107,11 +95,7 @@
amount_input = 0;
modal_open = false;
//
Toastify({
text: $_("donation_added"),
duration: 500,
backgroundColor: "linear-gradient(to right, #00b09b, #96c93d)",
}).showToast();
toast.success($_("donation_added"));
dispatch("created", { donations: [result] });
})
.catch((err) => {
@@ -119,8 +103,6 @@
})
.finally(() => {
processed_last_submit = true;
//
toast.hideToast();
});
}
}