Skip to content

Commit

Permalink
fix animation page
Browse files Browse the repository at this point in the history
  • Loading branch information
Anatoliy committed Aug 20, 2023
1 parent 64d5fbd commit a4acb09
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 39 deletions.
7 changes: 5 additions & 2 deletions src/lib/components/client/MainMenu.svelte
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
<script>
import IconUserCircle from '~icons/tabler/user-circle';
import { isMobile } from '$lib/client/utils';
import Dropdown from '$lib/components/Dropdown.svelte';
import { drawerStore } from '@skeletonlabs/skeleton';
export let user;
function drawerClose() {
drawerStore.close();
if (isMobile()) {
drawerStore.close();
}
}
</script>

<ul class="md:items-center md:flex-row flex flex-col gap-4">
<li>
<a
on:click={drawerClose}
href="/prices"
href="/pricing"
class="permalink text-slate-700 hover:text-blue-700 block px-2">Pricing</a
>
</li>
Expand Down
27 changes: 0 additions & 27 deletions src/routes/(app)/prices/+page.server.ts

This file was deleted.

26 changes: 26 additions & 0 deletions src/routes/(app)/pricing/+page.server.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { auth } from '$lib/server/lucia';
import { stripe } from '$lib/server/stripe';

export const load = async (event) => {
const authRequest = auth.handleRequest(event);
const session = await authRequest.validate();

let product = null;
if (session) {
const customers = await stripe.customers.list({
email: session?.user.email
});

if (customers?.data?.length) {
const subscriptions = await stripe.subscriptions.list({
customer: customers?.data[0].customer
});

const subscription = subscriptions?.data?.find((s) => s.status === 'active');

product = await stripe.products.retrieve(subscription?.plan.product);
}
}

return { product };
};
File renamed without changes.
2 changes: 1 addition & 1 deletion src/routes/(auth)/login/+page.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export const actions: Actions = {
console.log('verify.attempts', verify.attempts);

if (verify.attempts <= 0) {
return setError(otpForm, 'email', 'Attempts exhausted, try to enter new OTP');
return setError(otpForm, 'email', 'Attempts exhausted, try again');
}

return setError(otpForm, 'otp', 'Invalid verification code');
Expand Down
3 changes: 2 additions & 1 deletion src/routes/+layout.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export const load = async (event) => {
const session = await authRequest.validate();

return {
user: session?.user
user: session?.user,
url: event.url.pathname
};
};
8 changes: 0 additions & 8 deletions src/routes/admin/+layout.server.ts

This file was deleted.

0 comments on commit a4acb09

Please sign in to comment.