mirror of
https://github.com/mudabbir-ahmad/MAD-Treasure-Hunt.git
synced 2026-10-08 03:00:20 +00:00
Add initial JSON data files and implement core page components for game functionality
This commit is contained in:
1 parent
81847a9188
commit
ca27f8d6ed
54 files changed
+2424
-250
No files matched your search
@@ -0,0 +1,30 @@
|
||||
const session = {
|
||||
currentUid: null,
|
||||
currentGid: null,
|
||||
currentSGid: null,
|
||||
currentTGid: null,
|
||||
};
|
||||
|
||||
const setSessionUser = (user) => {
|
||||
session.currentUid = user?.Uid ?? null;
|
||||
session.currentGid = user?.Gid ?? null;
|
||||
session.currentSGid = user?.SGid ?? null;
|
||||
session.currentTGid = user?.TGid ?? null;
|
||||
};
|
||||
|
||||
const setSessionGroup = (gid, sgid = null) => {
|
||||
session.currentGid = gid ?? null;
|
||||
if (sgid !== null && sgid !== undefined) {
|
||||
session.currentSGid = sgid;
|
||||
}
|
||||
};
|
||||
|
||||
const setSessionTeam = (tgid) => {
|
||||
session.currentTGid = tgid ?? null;
|
||||
};
|
||||
|
||||
const getSession = () => ({ ...session });
|
||||
|
||||
export { setSessionUser, setSessionGroup, setSessionTeam, getSession };
|
||||
|
||||
|
||||
Reference in new issue
Block a user