Convert multiple pages into SPA

This commit is contained in:
2025-10-09 15:48:23 +02:00
parent c616b2da7f
commit 06d04a1abc
110 changed files with 1245 additions and 1319 deletions

View File

@@ -1,14 +1,13 @@
<script lang="ts">
import { onMount } from "svelte";
import Modal from "util/Modal.svelte";
import LoadingIndicator from "util/LoadingIndicator.svelte";
import { get_user, put_user } from "lib/PixeldrainAPI";
import { loading_finish, loading_start } from "lib/Loading";
// When the always flag is set then the pop-up will also show if the user
// already has an affiliate ID set
export let always = false
let modal: Modal
let loading: boolean
let referral: string
let shown = false
@@ -50,7 +49,7 @@ export const prompt = async (ref: string) => {
onMount(() => prompt(new URLSearchParams(document.location.search).get("ref")))
const allow = async () => {
loading = true
loading_start()
try {
await put_user({affiliate_user_name: referral})
@@ -59,7 +58,7 @@ const allow = async () => {
} catch (err) {
alert(err)
} finally {
loading = false
loading_finish()
}
}
@@ -70,7 +69,6 @@ const deny = () => {
</script>
<Modal bind:this={modal} title="Affiliate sponsoring request" width="700px">
<LoadingIndicator bind:loading={loading} />
<section>
<p>
Hi! {referral} wants you to sponsor their pixeldrain account. This