more stuff

This commit is contained in:
vel 2022-01-27 14:29:54 -08:00
parent 7ba50976cf
commit 5f81ed1756
Signed by: velvox
GPG Key ID: 8C470C59E7724537
6 changed files with 9 additions and 4 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
*/.env */.env
test test
*/.DS_STORE */.DS_STORE
.DS_STORE

1
backend/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
cmd/watchtogether/watchtogether

View File

@ -8,6 +8,7 @@ import { Container } from "../components/Container";
import { Footer } from "../components/Footer"; import { Footer } from "../components/Footer";
import { Hero } from "../components/Hero"; import { Hero } from "../components/Hero";
import { Main } from "../components/Main"; import { Main } from "../components/Main";
import isDev from "../util/isDev";
const Index: NextPage = () => { const Index: NextPage = () => {
return ( return (
@ -22,6 +23,7 @@ const Index: NextPage = () => {
maxWidth="200" maxWidth="200"
alignSelf="center" alignSelf="center"
onClick={() => signIn("discord")} onClick={() => signIn("discord")}
disabled={!isDev()}
> >
Login With Discord Login With Discord
</Button> </Button>

View File

@ -14,11 +14,10 @@ import isBrowser from "../util/isBrowser";
const Player = dynamic(() => import("../components/Player"), { ssr: false }); const Player = dynamic(() => import("../components/Player"), { ssr: false });
interface PlayerPageProps { interface PlayerPageProps {
URI: string;
user: User; user: User;
} }
const PlayerPage: NextPage<PlayerPageProps> = ({ URI, user }) => { const PlayerPage: NextPage<PlayerPageProps> = ({ user }) => {
const playerRef = useRef<ReactPlayer>(); const playerRef = useRef<ReactPlayer>();
const socket = useWS({ user }); const socket = useWS({ user });
const [id, setID] = useState<string>(""); const [id, setID] = useState<string>("");

View File

@ -0,0 +1,3 @@
export default function isDev() {
return process.env.NODE_ENV === "development";
}

View File

@ -1,5 +1,3 @@
// nice and easy way to get types for the
import { User } from "next-auth"; import { User } from "next-auth";
import EventEmitter from "events"; import EventEmitter from "events";
import IdentityData from "../interfaces/Identity"; import IdentityData from "../interfaces/Identity";
@ -8,6 +6,7 @@ import Message from "../util/Message";
import MessageUtil from "../util/MessageUtil"; import MessageUtil from "../util/MessageUtil";
// browser socket // browser socket
// todo: write a shim for this
let Websocket: typeof WebSocket; let Websocket: typeof WebSocket;
if (typeof window !== "undefined") { if (typeof window !== "undefined") {
Websocket = window.WebSocket; Websocket = window.WebSocket;