From 4d193814bba54b36fe990febae4938cd5bc3a20c Mon Sep 17 00:00:00 2001 From: Ezra Khairan Permana Date: Mon, 8 Jul 2024 23:58:52 +0700 Subject: [PATCH] chore: prettier --- .../src/context/participant-context.tsx | 22 ++++++++++++++----- .../chooser/src/context/server-setting.tsx | 2 +- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/apps/clients/chooser/src/context/participant-context.tsx b/apps/clients/chooser/src/context/participant-context.tsx index e04b50b..fcbdf76 100644 --- a/apps/clients/chooser/src/context/participant-context.tsx +++ b/apps/clients/chooser/src/context/participant-context.tsx @@ -2,14 +2,15 @@ import { createContext, useCallback, useContext, + useEffect, useMemo, useState, - useEffect } from "react"; import { UniversalError } from "@/components/universal-error"; import { api } from "@/utils/api"; import { motion } from "framer-motion"; import { Navigate } from "react-router-dom"; + import { useKeyboardWebsocket } from "./keyboard-websocket"; export interface IParticipantContext { @@ -56,17 +57,26 @@ export const ParticipantProvider = ({ switch (actualCommand) { case "RELOAD": { - if (!!qrId && - participantQuery.isFetched && ( - !participantQuery.data?.alreadyAttended || participantQuery.data?.alreadyChoosing - )) location.reload(); + if ( + !!qrId && + participantQuery.isFetched && + (!participantQuery.data?.alreadyAttended || + participantQuery.data?.alreadyChoosing) + ) + location.reload(); break; } } } } - }, [qrId, participantQuery.isFetched, participantQuery.data, wsEnabled, lastMessage]); + }, [ + qrId, + participantQuery.isFetched, + participantQuery.data, + wsEnabled, + lastMessage, + ]); const propsValue = useMemo(() => { if (!qrId) diff --git a/apps/clients/chooser/src/context/server-setting.tsx b/apps/clients/chooser/src/context/server-setting.tsx index e342ecc..289ed26 100644 --- a/apps/clients/chooser/src/context/server-setting.tsx +++ b/apps/clients/chooser/src/context/server-setting.tsx @@ -4,8 +4,8 @@ import { api } from "@/utils/api"; import { motion } from "framer-motion"; import { Loader } from "lucide-react"; -import { useParticipant } from "./participant-context"; import { useKeyboardWebsocket } from "./keyboard-websocket"; +import { useParticipant } from "./participant-context"; interface ISettingContext { canVote: boolean;