Fix react hooks bug
All checks were successful
Automated Container Build / build-and-push (push) Successful in 37s
All checks were successful
Automated Container Build / build-and-push (push) Successful in 37s
This commit is contained in:
parent
0dc80a2c43
commit
121bbf4b52
1 changed files with 0 additions and 15 deletions
|
|
@ -101,21 +101,6 @@ export default function OnlyOfficeEditor({ file, type, onClose }: OnlyOfficeEdit
|
||||||
|
|
||||||
const docServerUrl = 'https://office.elijahkuntz.com/';
|
const docServerUrl = 'https://office.elijahkuntz.com/';
|
||||||
|
|
||||||
// Add a diagnostic check to ensure the browser can reach the OnlyOffice server
|
|
||||||
useEffect(() => {
|
|
||||||
if (!config) return;
|
|
||||||
|
|
||||||
// We try to fetch the api.js script to see if it's blocked by DNS/SSL/Brave Shields
|
|
||||||
const scriptUrl = `${docServerUrl}web-apps/apps/api/documents/api.js`;
|
|
||||||
fetch(scriptUrl, { mode: 'no-cors' })
|
|
||||||
.then(() => {
|
|
||||||
console.log("OnlyOffice API script is reachable.");
|
|
||||||
})
|
|
||||||
.catch((err) => {
|
|
||||||
setLoadError(`Browser cannot reach ${scriptUrl}. This is usually caused by: 1) Missing DNS record for office.elijahkuntz.com, 2) Invalid SSL Certificate, or 3) Browser blocking the connection (Brave Shields). Please check your browser's Developer Console (F12) for the exact network error.`);
|
|
||||||
});
|
|
||||||
}, [config]);
|
|
||||||
|
|
||||||
const onDocumentReady = function (event: any) {
|
const onDocumentReady = function (event: any) {
|
||||||
console.log("Document is loaded");
|
console.log("Document is loaded");
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Reference in a new issue