Skip to content

Commit

Permalink
Adding changes to workflow for Frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
Frnn4268 committed May 29, 2024
1 parent 7f248a7 commit 56f5e1f
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 1 deletion.
3 changes: 2 additions & 1 deletion public/src/components/ChatContainer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ export default function ChatContainer({ currentChat, socket }) {
const scrollRef = useRef();
const [arrivalMessage, setArrivalMessage] = useState(null);

useEffect(async () => {
/* eslint-disable */
useEffect(async () => {
const data = await JSON.parse(
localStorage.getItem(process.env.REACT_APP_LOCALHOST_KEY)
);
Expand Down
2 changes: 2 additions & 0 deletions public/src/components/Contacts.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ export default function Contacts({ contacts, changeChat }) {
const [currentUserName, setCurrentUserName] = useState(undefined);
const [currentUserImage, setCurrentUserImage] = useState(undefined);
const [currentSelected, setCurrentSelected] = useState(undefined);

/* eslint-disable */
useEffect(async () => {
const data = await JSON.parse(
localStorage.getItem(process.env.REACT_APP_LOCALHOST_KEY)
Expand Down
1 change: 1 addition & 0 deletions public/src/components/SetAvatar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export default function SetAvatar() {
theme: "dark",
};

/* eslint-disable */
useEffect(async () => {
if (!localStorage.getItem(process.env.REACT_APP_LOCALHOST_KEY))
navigate("/login");
Expand Down
3 changes: 3 additions & 0 deletions public/src/components/Welcome.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@ import styled from "styled-components";
import Robot from "../assets/robot.gif";
export default function Welcome() {
const [userName, setUserName] = useState("");

/* eslint-disable */
useEffect(async () => {
setUserName(
await JSON.parse(
localStorage.getItem(process.env.REACT_APP_LOCALHOST_KEY)
).username
);
}, []);

return (
<Container>
<img src={Robot} alt="" />
Expand Down
2 changes: 2 additions & 0 deletions public/src/pages/Chat.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ export default function Chat() {
const [contacts, setContacts] = useState([]);
const [currentChat, setCurrentChat] = useState(undefined);
const [currentUser, setCurrentUser] = useState(undefined);

/* eslint-disable */
useEffect(async () => {
if (!localStorage.getItem(process.env.REACT_APP_LOCALHOST_KEY)) {
navigate("/login");
Expand Down
2 changes: 2 additions & 0 deletions public/src/pages/Login.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ export default function Login() {
pauseOnHover: true,
draggable: true
};

/* eslint-disable */
useEffect(() => {
if (localStorage.getItem(process.env.REACT_APP_LOCALHOST_KEY)) {
navigate("/");
Expand Down
1 change: 1 addition & 0 deletions public/src/pages/Register.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export default function Register() {
confirmPassword: "",
});

/* eslint-disable */
useEffect(() => {
if (localStorage.getItem(process.env.REACT_APP_LOCALHOST_KEY)) {
navigate("/");
Expand Down

0 comments on commit 56f5e1f

Please sign in to comment.