Convert multiple pages into SPA
This commit is contained in:
@@ -1,20 +1,18 @@
|
||||
<script>
|
||||
import Euro from "util/Euro.svelte"
|
||||
import LoadingIndicator from "util/LoadingIndicator.svelte";
|
||||
import SuccessMessage from "util/SuccessMessage.svelte";
|
||||
import PatreonActivationResult from "./PatreonActivationResult.svelte";
|
||||
import { loading_finish, loading_start } from "lib/Loading";
|
||||
|
||||
let loading = false
|
||||
let subscription = window.user.subscription.id
|
||||
let subscription_type = window.user.subscription.type
|
||||
let success_message
|
||||
|
||||
const update = async (plan) => {
|
||||
loading = true
|
||||
|
||||
const form = new FormData()
|
||||
form.append("subscription", plan)
|
||||
|
||||
loading_start()
|
||||
try {
|
||||
{
|
||||
const resp = await fetch(
|
||||
@@ -43,13 +41,11 @@ const update = async (plan) => {
|
||||
} catch (err) {
|
||||
success_message.set(false, "Failed to update subscription: "+err)
|
||||
} finally {
|
||||
loading = false
|
||||
loading_finish()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<LoadingIndicator loading={loading}/>
|
||||
|
||||
<section>
|
||||
{#if window.location.hash === "#checkout_complete"}
|
||||
<div class="highlight_green">
|
||||
|
Reference in New Issue
Block a user