Skip to content

Commit

Permalink
move invite page behind auth shell (#280)
Browse files Browse the repository at this point in the history
* move invite page behind auth shell

* try alternative supabase start calls in CI

* remove init since config.toml exists
  • Loading branch information
jongrim authored Jan 13, 2025
1 parent f9d353c commit ffea9a3
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ jobs:
- uses: supabase/setup-cli@v1
with:
version: latest
- run: supabase db start

- name: Start Supabase local development setup
run: supabase start
# - name: Start Supabase local development setup
# run: supabase start

- name: Verify generated types are checked in
run: |
Expand Down
14 changes: 2 additions & 12 deletions src/pages/InvitePage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,12 @@
<PrimaryButton
class="w-full mt-4"
:is-loading="joining"
:disabled="notSignedIn || joining"
:disabled="joining"
@click="joinCommunity"
>
Join now
</PrimaryButton>
</div>
<SignUpModal
:open="notSignedIn"
:allow-dismiss="false"
@signed-in="notSignedIn = false"
/>
</div>
</BaseTemplate>
</template>
Expand All @@ -43,7 +38,6 @@ import { onMounted, ref } from "vue";
import LoadingSpinner from "@/components/LoadingSpinner.vue";
import PrimaryButton from "@/components/Buttons/PrimaryButton.vue";
import useToast from "@/components/Toast/useToast";
import SignUpModal from "@/components/Modals/SignUpModal.vue";
const { showSuccess, showError } = useToast();
Expand All @@ -57,7 +51,6 @@ const inviteInfo = ref<{
const isLoading = ref(false);
const joining = ref(false);
const alreadyJoined = ref(false);
const notSignedIn = ref(false);
async function loadCommunityInvite() {
const { data } = await supabase
Expand Down Expand Up @@ -93,7 +86,7 @@ async function checkCommunityMember() {
async function joinCommunity() {
joining.value = true;
const { data } = await fetch(
`/.netlify/functions/joinThroughInviteLink?inviteId=${route.params.invite_id}&userId=${store.user?.id}&communityId=${inviteInfo.value?.community_id.id}`,
`/.netlify/functions/joinThroughInviteLink?inviteId=${route.params.invite_id}&userId=${store.user?.id}&communityId=${inviteInfo.value?.community_id.id}`
)
.then((response) => response.json())
.catch(() => {
Expand All @@ -110,9 +103,6 @@ async function joinCommunity() {
onMounted(async () => {
isLoading.value = true;
if (!store.user?.id) {
notSignedIn.value = true;
}
await loadCommunityInvite();
await checkCommunityMember();
isLoading.value = false;
Expand Down
9 changes: 9 additions & 0 deletions src/pages/InviteShell.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<template>
<AuthShell>
<InvitePage />
</AuthShell>
</template>
<script setup lang="ts">
import AuthShell from "@/layouts/AuthShell.vue";
import InvitePage from "./InvitePage.vue";
</script>
2 changes: 1 addition & 1 deletion src/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const routes = [
},
{
path: "/invite/:invite_id",
component: () => import("@/pages/InvitePage.vue"),
component: () => import("@/pages/InviteShell.vue"),
meta: {
title: "Playabl",
},
Expand Down

0 comments on commit ffea9a3

Please sign in to comment.