-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from hinagiku-dev/discussion
chatroom
- Loading branch information
Showing
7 changed files
with
59 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,7 @@ | |
main { | ||
margin-left: 0; | ||
transition: margin-left 0.3s ease; | ||
margin-top: 3.5rem; | ||
} | ||
main.sidebar-open { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 5 additions & 23 deletions
28
src/routes/session/[id]/discussion/[userId]/+page.server.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,12 @@ | ||
import { adminDb } from '$lib/server/firebase'; | ||
import { redirect } from '@sveltejs/kit'; | ||
import type { Actions, PageServerLoad } from '../$types'; | ||
import type { PageServerLoad } from './$types'; | ||
|
||
export const load: PageServerLoad = async ({ params, locals }) => { | ||
export const load: PageServerLoad = async ({ locals }) => { | ||
if (!locals.user) { | ||
throw redirect(303, '/login'); | ||
} | ||
|
||
const sessionRef = adminDb.collection('discussion').doc(params.id); | ||
console.log(sessionRef); | ||
//const sessionDoc = await sessionRef.get(); | ||
|
||
/* | ||
if (!sessionDoc.exists) { | ||
throw error(404, 'User is not in the session'); | ||
} | ||
*/ | ||
|
||
return {}; | ||
return { | ||
user: locals.user | ||
}; | ||
}; | ||
|
||
export const actions = { | ||
default: async ({ locals }) => { | ||
if (!locals.user) { | ||
throw redirect(303, '/login'); | ||
} | ||
//send message to the server | ||
} | ||
} satisfies Actions; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters