Fix Dynamix API routing and menu placement

This commit is contained in:
Mikei386
2026-06-22 22:27:19 +02:00
parent ae5e192eac
commit 51c8e7ac4d
8 changed files with 16 additions and 9 deletions
+9 -2
View File
@@ -26,7 +26,10 @@ init();
async function init() {
try {
state.config = await api(apiUrl('config'));
state.config = await api(apiUrl('config.php'));
if (!state.config.roots?.length) {
throw new Error('No U-Navigator roots configured');
}
statusText.textContent = `${state.config.roots.length} Root, ${state.config.readOnly ? 'Read-only' : 'Schreibzugriff aktiv'}`;
openExplorer(state.config.roots[0].path);
openProperties();
@@ -36,7 +39,11 @@ async function init() {
}
}
function openExplorer(initialPath = state.config?.roots[0]?.path) {
function openExplorer(initialPath = state.config?.roots?.[0]?.path) {
if (!initialPath) {
statusText.textContent = 'Kein Root-Pfad konfiguriert';
return null;
}
const win = createWindow('Explorer', 'explorer', {
width: 760,
height: 460,