Convert multiple pages into SPA
This commit is contained in:
1 parent
c616b2da7f
commit
06d04a1abc
110 files changed
+1245
-1319
No files matched your search
@@ -2,13 +2,12 @@
|
||||
import { countries } from "country-data-list";
|
||||
import { get_misc_vat_rate, put_user } from "lib/PixeldrainAPI";
|
||||
import { payment_providers, type CheckoutState } from "./CheckoutLib";
|
||||
import { loading_finish, loading_start } from "lib/Loading";
|
||||
|
||||
export let state: CheckoutState
|
||||
export let loading: boolean
|
||||
let country_input = ""
|
||||
|
||||
const set_country = async (e?: Event) => {
|
||||
loading = true
|
||||
if (e !== undefined) {
|
||||
e.preventDefault()
|
||||
}
|
||||
@@ -24,6 +23,7 @@ const set_country = async (e?: Event) => {
|
||||
// with an invalid combination
|
||||
state.provider = null
|
||||
|
||||
loading_start()
|
||||
try {
|
||||
// Save the user's country for later use
|
||||
await put_user({checkout_country: c.alpha3})
|
||||
@@ -34,7 +34,7 @@ const set_country = async (e?: Event) => {
|
||||
} catch (err) {
|
||||
alert(err)
|
||||
} finally {
|
||||
loading = false
|
||||
loading_finish()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user