Linting - Linting Complete

This commit is contained in:
2024-04-23 17:52:21 -04:00
parent 4b5454ddc2
commit 08c88fb59c
7 changed files with 11 additions and 48 deletions
+2 -1
View File
@@ -4,6 +4,7 @@
"no-unused-vars": ["warn", { "vars": "all", "args": "after-used", "ignoreRestSiblings": false }],
"jsx-a11y/alt-text": "off",
"@next/next/no-img-element": "off",
"no-console": 1
"no-console": 1,
"react-hooks/exhaustive-deps": "off"
}
}
+1 -1
View File
@@ -5,7 +5,7 @@ import { useState, useEffect } from "react";
// Firebase Imports
import { auth, database } from "../../../firebase-config";
import { ref, onValue, set, onDisconnect, get, onChildAdded, onChildRemoved } from "firebase/database";
import { ref, onValue, set, onDisconnect} from "firebase/database";
import { useAuthState } from "react-firebase-hooks/auth"
// Component Imports
+1 -1
View File
@@ -31,7 +31,7 @@ function Login() {
}
}
).catch((error) => {
if (error = "auth/invalid-credential") {
if (error == "auth/invalid-credential") {
const formError = {
type: "server",
message: "Username or Password Incorrect",
+3 -3
View File
@@ -46,9 +46,9 @@ function Home() {
get(ref(database, `/rooms/${path}`)).then((snapshot) => {
if (snapshot.exists()) {
var count = 0;
for (var room in snapshot.val()) {
count += 1;
}
snapshot.forEach(() => {
count++;
});
setRoomCount(count);
} else {
setRoomCount(0);
+1 -1
View File
@@ -2,7 +2,7 @@
// System Imports
import { useState, useEffect } from "react";
import { auth, database } from "../../../firebase-config";
import { ref, onValue, get } from "firebase/database";
import { ref, onValue } from "firebase/database";
import { useAuthState } from "react-firebase-hooks/auth"
@@ -1,5 +1,5 @@
import Link from "next/link"
import { use, useEffect, useState } from "react";
import { useEffect, useState } from "react";
const Filter = require('bad-words')
const filter = new Filter();
@@ -11,7 +11,7 @@ import PersonIcon from '@mui/icons-material/Person';
import DeleteOutlineIcon from '@mui/icons-material/DeleteOutline';
import CircleIcon from '@mui/icons-material/Circle';
import { useTts, TextToSpeech } from 'tts-react'
import { TextToSpeech } from 'tts-react'
// Chat Commands Dictionary
const chatCommands = {
@@ -54,7 +54,7 @@ let dateOptions = {
* @returns {Boolean} - Image Loaded (True) or Not (False)
*/
function imageProcessing(url) {
var x = new Promise((resolve, reject) => {
var x = new Promise((resolve) => {
var img = new Image();
img.src = url;
img.onload = () => {
@@ -6,44 +6,6 @@ import ChatBubbleTwoToneIcon from '@mui/icons-material/ChatBubbleTwoTone';
import PersonOutlineTwoToneIcon from '@mui/icons-material/PersonOutlineTwoTone';
import { red } from '@mui/material/colors';
/**
* Nearby Markers Grabber
* @param {JSON} location - Location Object {latitude, longitude}
* @returns {Array} - Array of Markers {<Marker>}
*/
function NearbyMarkers(location) {
const [newMarkers, setNewMarkers] = useState(null);
if (location) {
const path = String(location.latitude.toFixed(2)).replace(".", "") +"/" +String(location.longitude.toFixed(2)).replace(".", "") +"/";
get(ref(database, `/rooms/${path}`)).then((snapshot) => {
if (snapshot.exists()) {
const rooms = snapshot.val();
setNewMarkers(rooms)
}
})
}
return newMarkers;
}
/**
* Friend Markers Grabber
* @param {JSON} user - User Object
* @returns {Array} - Array of Markers {<Marker>}
*/
function FriendMarkers(user) {
var friendMarkers = []
if (user && "friends" in user && "friends" in user.friends) {
for (var friend in user.friends.friends) {
get(ref(database, `/users/${friend}`)).then((snapshot) => {
var friendData = snapshot.val();
if (friendData.location) {
friendMarkers.push(friendData);
}
});
}
}
}
/**
* Geo Component for Wrapping Map
* @constructor