mirror of
https://gitlab.com/MrFry/qmining-page
synced 2025-04-01 20:23:44 +02:00
Added global header, refetch infos on window focus
This commit is contained in:
parent
98164ff4fa
commit
a8ec93a685
12 changed files with 47 additions and 55 deletions
|
@ -1,11 +1,11 @@
|
|||
import React from 'react'
|
||||
import Head from 'next/head'
|
||||
import io from 'socket.io-client'
|
||||
import linkifyString from 'linkify-string'
|
||||
|
||||
import constants from '../constants.json'
|
||||
import LoadingIndicator from '../components/LoadingIndicator'
|
||||
import { queryClient } from '../pages/_app'
|
||||
import Header from '../components/header'
|
||||
|
||||
import styles from './chat.module.css'
|
||||
|
||||
|
@ -109,9 +109,6 @@ export default class Chat extends React.Component {
|
|||
connected: false,
|
||||
selectedUser: 0,
|
||||
}
|
||||
if (props.refetchGlobalData) {
|
||||
props.refetchGlobalData()
|
||||
}
|
||||
if (props.globalData && !isNaN(props.globalData.userId)) {
|
||||
this.state.user = props.globalData.userId
|
||||
this.connect(this.props.globalData.userId)
|
||||
|
@ -325,9 +322,6 @@ export default class Chat extends React.Component {
|
|||
|
||||
chatMessageSeen(chatPartner) {
|
||||
const { msgs, user } = this.state
|
||||
if (this.props.refetchGlobalData) {
|
||||
this.props.refetchGlobalData()
|
||||
}
|
||||
this.socket.emit('chat message read', { chatPartner: chatPartner })
|
||||
this.setState({
|
||||
msgs: {
|
||||
|
@ -670,9 +664,7 @@ export default class Chat extends React.Component {
|
|||
|
||||
return (
|
||||
<div className={styles.chat}>
|
||||
<Head>
|
||||
<title>Chat - Qmining | Frylabs.net</title>
|
||||
</Head>
|
||||
<Header title={'Chat'} />
|
||||
{connected ? (
|
||||
<>
|
||||
<div className={styles.main}>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue