Merge branch 'dev'
This commit is contained in:
commit
48adc13f15
10 changed files with 16 additions and 16 deletions
|
@ -1,5 +1,5 @@
|
||||||
import { getAuth } from "@clerk/remix/ssr.server";
|
import { getAuth } from "@clerk/remix/ssr.server";
|
||||||
import { LoaderFunctionArgs, json } from "@remix-run/node";
|
import { type LoaderFunctionArgs, json } from "@remix-run/node";
|
||||||
import { eq } from "drizzle-orm";
|
import { eq } from "drizzle-orm";
|
||||||
import { eventStream } from "remix-utils/sse/server";
|
import { eventStream } from "remix-utils/sse/server";
|
||||||
import { db } from "~/services/db.server";
|
import { db } from "~/services/db.server";
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { getAuth } from "@clerk/remix/ssr.server";
|
import { getAuth } from "@clerk/remix/ssr.server";
|
||||||
import { LoaderFunctionArgs, json } from "@remix-run/node";
|
import { type LoaderFunctionArgs, json } from "@remix-run/node";
|
||||||
import { eq } from "drizzle-orm";
|
import { eq } from "drizzle-orm";
|
||||||
import { eventStream } from "remix-utils/sse/server";
|
import { eventStream } from "remix-utils/sse/server";
|
||||||
import { db } from "~/services/db.server";
|
import { db } from "~/services/db.server";
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { getAuth } from "@clerk/remix/ssr.server";
|
import { getAuth } from "@clerk/remix/ssr.server";
|
||||||
import { LoaderFunctionArgs, json } from "@remix-run/node";
|
import { type LoaderFunctionArgs, json } from "@remix-run/node";
|
||||||
import { and, eq } from "drizzle-orm";
|
import { and, eq } from "drizzle-orm";
|
||||||
import { eventStream } from "remix-utils/sse/server";
|
import { eventStream } from "remix-utils/sse/server";
|
||||||
import { db } from "~/services/db.server";
|
import { db } from "~/services/db.server";
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { getAuth } from "@clerk/remix/ssr.server";
|
import { getAuth } from "@clerk/remix/ssr.server";
|
||||||
import { ActionFunctionArgs, json } from "@remix-run/node";
|
import { type ActionFunctionArgs, json } from "@remix-run/node";
|
||||||
import { createId } from "@paralleldrive/cuid2";
|
import { createId } from "@paralleldrive/cuid2";
|
||||||
import { db } from "~/services/db.server";
|
import { db } from "~/services/db.server";
|
||||||
import { emitter } from "~/services/emitter.server";
|
import { emitter } from "~/services/emitter.server";
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { getAuth } from "@clerk/remix/ssr.server";
|
import { getAuth } from "@clerk/remix/ssr.server";
|
||||||
import { ActionFunctionArgs, json } from "@remix-run/node";
|
import { type ActionFunctionArgs, json } from "@remix-run/node";
|
||||||
import { createId } from "@paralleldrive/cuid2";
|
import { createId } from "@paralleldrive/cuid2";
|
||||||
import { db } from "~/services/db.server";
|
import { db } from "~/services/db.server";
|
||||||
import { emitter } from "~/services/emitter.server";
|
import { emitter } from "~/services/emitter.server";
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { getAuth } from "@clerk/remix/ssr.server";
|
import { getAuth } from "@clerk/remix/ssr.server";
|
||||||
import { LoaderFunctionArgs, json } from "@remix-run/node";
|
import { type LoaderFunctionArgs, json } from "@remix-run/node";
|
||||||
import { eq } from "drizzle-orm";
|
import { eq } from "drizzle-orm";
|
||||||
import { eventStream } from "remix-utils/sse/server";
|
import { eventStream } from "remix-utils/sse/server";
|
||||||
import { db } from "~/services/db.server";
|
import { db } from "~/services/db.server";
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { ActionFunctionArgs, json } from "@remix-run/node";
|
import { type ActionFunctionArgs, json } from "@remix-run/node";
|
||||||
import { Webhook } from "svix";
|
import { Webhook } from "svix";
|
||||||
import { WebhookEvent } from "@clerk/remix/api.server";
|
import { type WebhookEvent } from "@clerk/remix/api.server";
|
||||||
import {
|
import {
|
||||||
onUserCreatedHandler,
|
onUserCreatedHandler,
|
||||||
onUserDeletedHandler,
|
onUserDeletedHandler,
|
||||||
|
|
|
@ -51,7 +51,7 @@ export default function Dashboard() {
|
||||||
|
|
||||||
function DashboardContent() {
|
function DashboardContent() {
|
||||||
const { user, isLoaded } = useUser();
|
const { user, isLoaded } = useUser();
|
||||||
let roomsFromDb = useEventSource("/api/room/get/all", { event: user?.id! });
|
let roomsFromDb = useEventSource("/api/room/get/all", { event: user?.id });
|
||||||
|
|
||||||
let roomsFromDbParsed = JSON.parse(roomsFromDb!) as RoomsResponse;
|
let roomsFromDbParsed = JSON.parse(roomsFromDb!) as RoomsResponse;
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { getAuth } from "@clerk/remix/ssr.server";
|
import { getAuth } from "@clerk/remix/ssr.server";
|
||||||
import { LoaderFunction, redirect } from "@remix-run/node";
|
import { type LoaderFunction, redirect } from "@remix-run/node";
|
||||||
import { useParams } from "@remix-run/react";
|
import { useParams } from "@remix-run/react";
|
||||||
import {
|
import {
|
||||||
CheckCircleIcon,
|
CheckCircleIcon,
|
||||||
|
@ -17,7 +17,7 @@ import {
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import LoadingIndicator from "~/components/LoadingIndicator";
|
import LoadingIndicator from "~/components/LoadingIndicator";
|
||||||
import { useEventSource } from "remix-utils/sse/react";
|
import { useEventSource } from "remix-utils/sse/react";
|
||||||
import {
|
import type {
|
||||||
PresenceItem,
|
PresenceItem,
|
||||||
RoomResponse,
|
RoomResponse,
|
||||||
VoteResponse,
|
VoteResponse,
|
||||||
|
@ -223,12 +223,12 @@ function RoomContent() {
|
||||||
);
|
);
|
||||||
|
|
||||||
if (visible) {
|
if (visible) {
|
||||||
if (!!matchedVote) {
|
if (matchedVote) {
|
||||||
return <div>{matchedVote.value}</div>;
|
return <div>{matchedVote.value}</div>;
|
||||||
} else {
|
} else {
|
||||||
return <HourglassIcon className="text-xl text-error" />;
|
return <HourglassIcon className="text-xl text-error" />;
|
||||||
}
|
}
|
||||||
} else if (!!matchedVote) {
|
} else if (matchedVote) {
|
||||||
return <CheckCircleIcon className="text-xl text-success" />;
|
return <CheckCircleIcon className="text-xl text-success" />;
|
||||||
} else {
|
} else {
|
||||||
return <HourglassIcon className="text-xl animate-spin text-warning" />;
|
return <HourglassIcon className="text-xl animate-spin text-warning" />;
|
||||||
|
@ -296,7 +296,7 @@ function RoomContent() {
|
||||||
<div className="w-10 rounded-full avatar">
|
<div className="w-10 rounded-full avatar">
|
||||||
<img
|
<img
|
||||||
src={presenceItem.userImageUrl}
|
src={presenceItem.userImageUrl}
|
||||||
alt={`${presenceItem.userFullName}'s Profile Picture`}
|
alt={`${presenceItem.userFullName}'s Profile`}
|
||||||
height={32}
|
height={32}
|
||||||
width={32}
|
width={32}
|
||||||
/>
|
/>
|
||||||
|
@ -335,7 +335,7 @@ function RoomContent() {
|
||||||
{roomFromDb &&
|
{roomFromDb &&
|
||||||
votesFromDb &&
|
votesFromDb &&
|
||||||
voteString(
|
voteString(
|
||||||
roomFromDbParsed?.visible!,
|
roomFromDbParsed?.visible || false,
|
||||||
votesFromDbParsed,
|
votesFromDbParsed,
|
||||||
presenceItem
|
presenceItem
|
||||||
)}
|
)}
|
||||||
|
|
|
@ -86,7 +86,7 @@ export const subscribeToChannel = async (
|
||||||
};
|
};
|
||||||
|
|
||||||
export const unsubscribeToChannel = (channel: string) => {
|
export const unsubscribeToChannel = (channel: string) => {
|
||||||
`Unsubscribed successfully from ${channel}!`;
|
console.log(`Unsubscribed successfully from ${channel}!`);
|
||||||
Promise.resolve([sub?.unsubscribe(channel)]);
|
Promise.resolve([sub?.unsubscribe(channel)]);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue