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/wp-conte.../plugins/leadin/scripts/iframe
File: useBackgroundApp.ts
import { createContext, useContext } from 'react';
[0] Fix | Delete
import {
[1] Fix | Delete
deviceId,
[2] Fix | Delete
hubspotBaseUrl,
[3] Fix | Delete
locale,
[4] Fix | Delete
portalId,
[5] Fix | Delete
} from '../constants/leadinConfig';
[6] Fix | Delete
import { Message } from './messageMiddleware';
[7] Fix | Delete
[8] Fix | Delete
export const BackgroudAppContext = createContext<any>(null);
[9] Fix | Delete
[10] Fix | Delete
export function useBackgroundAppContext() {
[11] Fix | Delete
return useContext(BackgroudAppContext);
[12] Fix | Delete
}
[13] Fix | Delete
[14] Fix | Delete
export function usePostBackgroundMessage() {
[15] Fix | Delete
const app = useBackgroundAppContext();
[16] Fix | Delete
[17] Fix | Delete
return (message: Message) => {
[18] Fix | Delete
app.postMessage(message);
[19] Fix | Delete
};
[20] Fix | Delete
}
[21] Fix | Delete
[22] Fix | Delete
export function usePostAsyncBackgroundMessage(): (
[23] Fix | Delete
message: Message
[24] Fix | Delete
) => Promise<any> {
[25] Fix | Delete
const app = useBackgroundAppContext();
[26] Fix | Delete
return (message: Message) => app.postAsyncMessage(message);
[27] Fix | Delete
}
[28] Fix | Delete
[29] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function