{refCurrentCue.current?.name}
@@ -866,12 +877,12 @@ export function FreeFlow(){
{/*
*/}
{/*
*/}
-
+ {/*
*/}
{/*
diff --git a/vite/src/util/useUser.jsx b/vite/src/util/useUser.jsx
index 0c6d48d..bf5fac5 100644
--- a/vite/src/util/useUser.jsx
+++ b/vite/src/util/useUser.jsx
@@ -6,12 +6,12 @@ import { useData } from "./useData";
const userContext=createContext();
const SessionTime={
- A:["12:00", "13:30"],
- B:["13:30", "15:00"],
- C:["15:00", "17:30"],
- D:["17:30", "19:00"],
- E:["19:00", "20:30"],
- F:["20:30", "22:00"]
+ "1200":["13:00", "14:00"],
+ "1330":["14:20", "15:30"],
+ "1500":["16:00", "17:00"],
+ "1730":["18:30", "19:30"],
+ "1900":["20:00", "21:00"],
+ "2030":["21:30", "23:00"]
}
@@ -28,9 +28,7 @@ export function UserProvider({children}) {
const {data}=useData();
- function getSessionId(){
- return `${SessionTime[sessionId]!=null? SessionTime[sessionId][0].replace(':',''):'no-session'}`;
- }
+
function getFileId(){
if(!userId){
if(data?.id){
@@ -115,20 +113,31 @@ export function UserProvider({children}) {
});
},[choice, summary, refPassword.current]);
-
- useEffect(() => {
-
- let symbol='';
-
- for(const [key, value] of Object.entries(SessionTime)){
+
+ function getSessionId(time){
+ let symbol='no-session';
+ for(const [key, value] of Object.entries(SessionTime)){
const start=moment(value[0], "HH:mm");
const end=moment(value[1], "HH:mm");
- if(moment().isBetween(start, end)){
- symbol=key;
- break;
+ if(time){
+ const checkTime=moment(time, "HH:mm");
+ if(checkTime.isBetween(start, end)){
+ return key;
+ }
+ }else{
+ if(moment().isBetween(start, end)){
+ symbol=key;
+ break;
+ }
}
}
+ return symbol;
+ }
+ useEffect(() => {
+
+
+ const symbol=getSessionId();
setSessionId(symbol);
@@ -137,6 +146,10 @@ export function UserProvider({children}) {
console.log("Session ID changed:", sessionId);
}, [sessionId]);
+
+ // console.log(getSessionId(), getSessionId("13:12"), getSessionId("14:55"), getSessionId("2213"));
+
+
// useEffect(()=>{
// refChoice.current=choice;
// console.log("Choice changed:", choice);