Fix react hooks bug
All checks were successful
Automated Container Build / build-and-push (push) Successful in 37s

This commit is contained in:
Elijah 2026-05-24 11:54:17 -07:00
parent 0dc80a2c43
commit 121bbf4b52

View file

@ -101,21 +101,6 @@ export default function OnlyOfficeEditor({ file, type, onClose }: OnlyOfficeEdit
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) {
console.log("Document is loaded");
};