Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into feat/bun
Browse files Browse the repository at this point in the history
  • Loading branch information
ImSoZRious committed Mar 30, 2024
2 parents 5db16c7 + aa99712 commit 9ef0f9a
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 38 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ jobs:
with:
push: true
context: "{{defaultContext}}:apps/server"
tags: ${{ env.IMAGE_NAME }}:latest
tags: ${{ env.IMAGE_NAME }}:${{ inputs.tag }}
cache-from: type=gha,ref=${{ env.IMAGE_NAME }}:buildcache
cache-to: type=gha,ref=${{ env.IMAGE_NAME }}:buildcache,mode=max
5 changes: 2 additions & 3 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,14 @@
"lint": "next lint"
},
"dependencies": {
"@fingerprintjs/fingerprintjs": "^4.2.2",
"axios": "^1.6.8",
"js-cookie": "^3.0.5",
"next": "14.1.4",
"react": "^18",
"react-dom": "^18",
"socket.io-client": "^4.7.5",
"uuid": "^9.0.1",
"universal-cookie": "^7.1.0"
"universal-cookie": "^7.1.0",
"uuid": "^9.0.1"
},
"devDependencies": {
"@types/js-cookie": "^3.0.6",
Expand Down
22 changes: 7 additions & 15 deletions apps/web/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 11 additions & 13 deletions apps/web/src/app/(screen)/screen/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ import { useEffect, useState } from "react";
import OverLay from "./components/Overlay";
import Display from "./components/Display";
import Cookies from "universal-cookie";
import FingerprintJS from "@fingerprintjs/fingerprintjs";
import { Socket, io } from "socket.io-client";
import { v4 as uuidv4 } from 'uuid';

const Screen = () => {
let fid: string | null = null;
const [showedPage, setShowPage] = useState<"overlay" | "display">("overlay");
const [ data, setData ] = useState({
status: "waiting",
Expand Down Expand Up @@ -61,20 +62,17 @@ const Screen = () => {
};

(async () => {
const savedCid = cookies.get('cid');

if(!cookies.get('fid')){
const fp = await FingerprintJS.load();
const result = await fp.get();
const fid = result.visitorId;
cookies.set('fid', fid)
fid = cookies.get('fid');
if (!fid) {
fid = uuidv4();
cookies.set('fid', fid);
}

const fid = cookies.get('fid')
const savedCid = cookies.get('cid');

const extraHeaders: { [key: string]: string } = {
fid: fid,
name: 'pun1'
fid: fid || '',
name: 'john'
};

if (savedCid) {
Expand Down
9 changes: 3 additions & 6 deletions apps/web/src/app/(user)/shake/[university]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ import ShakeComponent from '../../../../components/Shake';
import { useParams, useSearchParams } from "next/navigation";
import { Suspense } from 'react';
import { io, Socket } from "socket.io-client";
import FingerprintJS from '@fingerprintjs/fingerprintjs';
import Cookies from 'universal-cookie';

import { v4 as uuidv4 } from 'uuid';
let shaking: { x: number; y: number; z: number } | undefined;

function normalize(x: number, y: number, z: number) {
Expand Down Expand Up @@ -55,17 +54,15 @@ export default function Shake() {
(async () => {
fid = cookies.get('fid');
if (!fid) {
const fp = await FingerprintJS.load();
const result = await fp.get();
fid = result.visitorId;
fid = uuidv4();
cookies.set('fid', fid);
}


const savedCid = cookies.get('cid');

const extraHeaders: { [key: string]: string } = {
fid: fid,
fid: fid || '',
name: 'john'
};

Expand Down

0 comments on commit 9ef0f9a

Please sign in to comment.