Convert multiple pages into SPA
This commit is contained in:
@@ -2,9 +2,7 @@
|
||||
import { onMount } from "svelte";
|
||||
import { formatDataVolume, formatDate } from "util/Formatting";
|
||||
import Euro from "util/Euro.svelte"
|
||||
import LoadingIndicator from "util/LoadingIndicator.svelte";
|
||||
|
||||
let loading = false
|
||||
import { loading_finish, loading_start } from "lib/Loading";
|
||||
|
||||
let year = 0
|
||||
let month = 0
|
||||
@@ -22,7 +20,7 @@ let transactions = {
|
||||
}
|
||||
|
||||
const load_transactions = async () => {
|
||||
loading = true
|
||||
loading_start()
|
||||
month_str = year + "-" + ("00"+(month)).slice(-2)
|
||||
try {
|
||||
const resp = await fetch(window.api_endpoint+"/user/transactions/"+month_str)
|
||||
@@ -67,7 +65,7 @@ const load_transactions = async () => {
|
||||
} catch (err) {
|
||||
alert(err)
|
||||
} finally {
|
||||
loading = false
|
||||
loading_finish()
|
||||
}
|
||||
};
|
||||
const last_month = () => {
|
||||
@@ -97,8 +95,6 @@ onMount(() => {
|
||||
})
|
||||
</script>
|
||||
|
||||
<LoadingIndicator loading={loading}/>
|
||||
|
||||
<section>
|
||||
<h2>Transaction log</h2>
|
||||
<p>
|
||||
|
||||
Reference in New Issue
Block a user