fix: EDeclicLib null test
This commit is contained in:
@@ -27,8 +27,10 @@ class Messager extends Component {
|
|||||||
|
|
||||||
async componentDidMount() {
|
async componentDidMount() {
|
||||||
EdeclicLib = (await import('./firebase-client.js')).default
|
EdeclicLib = (await import('./firebase-client.js')).default
|
||||||
if (!EdeclicLib.messaging)
|
if (!EdeclicLib||!EdeclicLib.messaging)
|
||||||
return
|
return
|
||||||
|
console.log('componentDidMount')
|
||||||
|
|
||||||
this.setState({ tokenStopListener: EdeclicLib.messaging.onTokenRefresh(this.RefreshToken) })
|
this.setState({ tokenStopListener: EdeclicLib.messaging.onTokenRefresh(this.RefreshToken) })
|
||||||
this.setState({ messageStopListener: EdeclicLib.messaging.onMessage(this.MessageReceiver) })
|
this.setState({ messageStopListener: EdeclicLib.messaging.onMessage(this.MessageReceiver) })
|
||||||
|
|
||||||
@@ -36,8 +38,9 @@ class Messager extends Component {
|
|||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
|
|
||||||
if (process.browser) {
|
if (process.browser) {
|
||||||
if (!EdeclicLib.messaging)
|
if (!EdeclicLib||!EdeclicLib.messaging)
|
||||||
return
|
return
|
||||||
|
console.log('componentWillUnmount')
|
||||||
if (!!this.state.tokenStopListener)
|
if (!!this.state.tokenStopListener)
|
||||||
this.state.tokenStopListener();
|
this.state.tokenStopListener();
|
||||||
if (!!this.state.messageStopListener)
|
if (!!this.state.messageStopListener)
|
||||||
|
|||||||
+2
-1
@@ -32,12 +32,13 @@ class ListeSAV extends React.Component {
|
|||||||
async componentDidMount() {
|
async componentDidMount() {
|
||||||
|
|
||||||
if (!!localStorage.AG2LToken) {
|
if (!!localStorage.AG2LToken) {
|
||||||
|
|
||||||
const res = await fetch(publicRuntimeConfig.apiUrl.Qtbl_Itv_Sav + '?range=0-1',
|
const res = await fetch(publicRuntimeConfig.apiUrl.Qtbl_Itv_Sav + '?range=0-1',
|
||||||
{
|
{
|
||||||
method: "GET",
|
method: "GET",
|
||||||
headers: {
|
headers: {
|
||||||
"Accept": "application/json",
|
"Accept": "application/json",
|
||||||
'Authorization': 'Bearer ' + localStorage.AG2LToken
|
'Authorization': 'Bearer ' + localStorage.AG2LToken,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user