Skip to content

Commit

Permalink
Update index.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
ProLoser authored Oct 1, 2024
1 parent 4fecc75 commit f92e9ab
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/Online/Friends/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import { MultiplayerContext, Match, ModalContext } from '../Contexts';
import { Avatar } from '../Profile';
import { formatDistance } from 'date-fns';

// const toggleFullscreen = () => document.fullscreenElement
// ? document.exitFullscreen()
// : document.documentElement.requestFullscreen()
const toggleFullscreen = () => document.fullscreenElement
? document.exitFullscreen()
: document.documentElement.requestFullscreen()
type Users = {[key: string]: UserData}

export default function Friends() {
Expand All @@ -25,14 +25,14 @@ export default function Friends() {
const { toggle } = useContext(ModalContext);
const [matches, setMatches] = useState<firebase.database.DataSnapshot>([]);
const [searchResults, setSearchResults] = useState<firebase.database.DataSnapshot>([]);
// const [fullscreen, setFullscreen] = useState(!!document.fullscreenElement);
const [fullscreen, setFullscreen] = useState(!!document.fullscreenElement);

// // Synchronize Fullscreen Icon
// useEffect(() => {
// const fullscreenchange = () => setFullscreen(!!document.fullscreenElement);
// document.addEventListener('fullscreenchange', fullscreenchange);
// return () => document.removeEventListener('fullscreenchange', fullscreenchange);
// })
// Synchronize Fullscreen Icon
useEffect(() => {
const fullscreenchange = () => setFullscreen(!!document.fullscreenElement);
document.addEventListener('fullscreenchange', fullscreenchange);
return () => document.removeEventListener('fullscreenchange', fullscreenchange);
})


// Synchronize Matches
Expand Down

0 comments on commit f92e9ab

Please sign in to comment.