Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/leadin/scripts/shared/Meeting/hooks
File: useCurrentUserFetch.ts
import { useEffect, useState } from 'react';
[0] Fix | Delete
import { usePostAsyncBackgroundMessage } from '../../../iframe/useBackgroundApp';
[1] Fix | Delete
import LoadState, { LoadStateType } from '../../enums/loadState';
[2] Fix | Delete
import { ProxyMessages } from '../../../iframe/integratedMessages';
[3] Fix | Delete
[4] Fix | Delete
let user: any = null;
[5] Fix | Delete
[6] Fix | Delete
export default function useCurrentUserFetch() {
[7] Fix | Delete
const proxy = usePostAsyncBackgroundMessage();
[8] Fix | Delete
const [loadState, setLoadState] = useState<LoadStateType>(
[9] Fix | Delete
LoadState.NotLoaded
[10] Fix | Delete
);
[11] Fix | Delete
const [error, setError] = useState<null | Error>(null);
[12] Fix | Delete
[13] Fix | Delete
const createUser = () => {
[14] Fix | Delete
if (!user) {
[15] Fix | Delete
setLoadState(LoadState.NotLoaded);
[16] Fix | Delete
}
[17] Fix | Delete
};
[18] Fix | Delete
[19] Fix | Delete
const reload = () => {
[20] Fix | Delete
user = null;
[21] Fix | Delete
setLoadState(LoadState.NotLoaded);
[22] Fix | Delete
setError(null);
[23] Fix | Delete
};
[24] Fix | Delete
[25] Fix | Delete
useEffect(() => {
[26] Fix | Delete
if (loadState === LoadState.NotLoaded && !user) {
[27] Fix | Delete
setLoadState(LoadState.Loading);
[28] Fix | Delete
proxy({
[29] Fix | Delete
key: ProxyMessages.FetchOrCreateMeetingUser,
[30] Fix | Delete
})
[31] Fix | Delete
.then(data => {
[32] Fix | Delete
user = data;
[33] Fix | Delete
setLoadState(LoadState.Idle);
[34] Fix | Delete
})
[35] Fix | Delete
.catch(err => {
[36] Fix | Delete
setError(err);
[37] Fix | Delete
setLoadState(LoadState.Failed);
[38] Fix | Delete
});
[39] Fix | Delete
}
[40] Fix | Delete
}, [loadState]);
[41] Fix | Delete
[42] Fix | Delete
return { user, loadUserState: loadState, error, createUser, reload };
[43] Fix | Delete
}
[44] Fix | Delete
[45] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function