From 74cd480aa98a209db3febfb9dbc6871ff6d829f4 Mon Sep 17 00:00:00 2001 From: Aaro_laptop Date: Sat, 18 Feb 2023 21:34:22 +0200 Subject: [PATCH] version number --- package-lock.json | 4 ++-- package.json | 2 +- src/pages/message.tsx | 27 ++------------------------- 3 files changed, 5 insertions(+), 28 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1d98226..ad452e3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "suppis-nettisivut", - "version": "0.1.0", + "version": "2.0.0-Beta", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "suppis-nettisivut", - "version": "0.1.0", + "version": "2.0.0-Beta", "dependencies": { "@testing-library/jest-dom": "^5.16.5", "@testing-library/react": "^13.4.0", diff --git a/package.json b/package.json index 9f6ee76..91d5c65 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "suppis-nettisivut", - "version": "2.0.0-Beta", + "version": "1.0.0-rc.1", "private": true, "dependencies": { "@testing-library/jest-dom": "^5.16.5", diff --git a/src/pages/message.tsx b/src/pages/message.tsx index 1158919..fb6958d 100644 --- a/src/pages/message.tsx +++ b/src/pages/message.tsx @@ -1,6 +1,7 @@ import React, {useEffect, useState} from "react"; -import {getAppCheckTokenForApiCall, getIdTokenForApiCall} from "../firebaseConfig"; +import {auth, getAppCheckTokenForApiCall, getIdTokenForApiCall} from "../firebaseConfig"; import axios, {AxiosResponse} from "axios"; +import {onAuthStateChanged} from "firebase/auth"; const Papa = require("papaparse") @@ -12,30 +13,6 @@ export default function MessageWrapper() { const [showQr, setShowQr] = useState(false) const [selectedFile, setSelectedFile] = useState(null) - useEffect(() => { - const x = async () => { - try { - - // Getting tokens from Firebase to send along the API request, so backend can ensure that user has correct access rights - const idToken = await getIdTokenForApiCall() - const appCheckToken = await getAppCheckTokenForApiCall() - - const result: AxiosResponse = await axios.get("http://localhost:3001/whatsapp/status", { - headers: { - "X-Firebase-IdToken": idToken, - "X-Firebase-AppCheck": appCheckToken.token - } - }) - - console.log(result.data) - - } catch (error: any) { - handleMessageApiCallResponse(error) - } - } - x() - }, []) - const setFile = (event: any) => { setSelectedFile(event.target.files[0]) }