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/shared/Form/hooks
File: useForms.ts
import { useState } from 'react';
[0] Fix | Delete
import debounce from 'lodash/debounce';
[1] Fix | Delete
import { usePostAsyncBackgroundMessage } from '../../../iframe/useBackgroundApp';
[2] Fix | Delete
import { DEFAULT_OPTIONS } from '../../../constants/defaultFormOptions';
[3] Fix | Delete
import { ProxyMessages } from '../../../iframe/integratedMessages';
[4] Fix | Delete
import { IForm } from '../../types';
[5] Fix | Delete
[6] Fix | Delete
export default function useForms() {
[7] Fix | Delete
const proxy = usePostAsyncBackgroundMessage();
[8] Fix | Delete
const [formApiError, setFormApiError] = useState<any>(null);
[9] Fix | Delete
[10] Fix | Delete
const search = debounce(
[11] Fix | Delete
(search: string, callback: Function) => {
[12] Fix | Delete
return proxy({
[13] Fix | Delete
key: ProxyMessages.FetchForms,
[14] Fix | Delete
payload: {
[15] Fix | Delete
search,
[16] Fix | Delete
},
[17] Fix | Delete
})
[18] Fix | Delete
.then(forms => {
[19] Fix | Delete
callback([
[20] Fix | Delete
...forms.map((form: IForm) => ({
[21] Fix | Delete
label: form.name,
[22] Fix | Delete
value: form.guid,
[23] Fix | Delete
})),
[24] Fix | Delete
DEFAULT_OPTIONS,
[25] Fix | Delete
]);
[26] Fix | Delete
})
[27] Fix | Delete
.catch(error => {
[28] Fix | Delete
setFormApiError(error);
[29] Fix | Delete
});
[30] Fix | Delete
},
[31] Fix | Delete
300,
[32] Fix | Delete
{ trailing: true }
[33] Fix | Delete
);
[34] Fix | Delete
[35] Fix | Delete
return {
[36] Fix | Delete
search,
[37] Fix | Delete
formApiError,
[38] Fix | Delete
reset: () => setFormApiError(null),
[39] Fix | Delete
};
[40] Fix | Delete
}
[41] Fix | Delete
[42] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function