diff --git a/admin-dashboard.html b/admin-dashboard.html
index b16df08..b56feeb 100644
--- a/admin-dashboard.html
+++ b/admin-dashboard.html
@@ -901,18 +901,7 @@
-
-
-
-
-
-
-
-
+
@@ -1725,11 +1714,13 @@ async function saveApp(event) {
const appId = document.getElementById('appId').value;
// Basic validation
- const name = document.getElementById('appName').value.trim();
- const url = document.getElementById('appLink').value.trim();
- const description = document.getElementById('appDescription').value.trim();
- const icon = document.getElementById('appIcon').value || 'fas fa-cube';
- const color = document.getElementById('appColor').value || '#4a6cf7';
+ const name = document.getElementById('appName')?.value.trim() || '';
+ const url = document.getElementById('appLink')?.value.trim() || '';
+ const description = document.getElementById('appDescription')?.value.trim() || '';
+ const icon = document.getElementById('appIconClass')?.value || 'fas fa-cube';
+ const color = document.getElementById('appColor')?.value || '#4a6cf7';
+
+ console.log('Saving app with data:', { name, url, description, icon, color });
if (!name) {
showNotification('Název aplikace je povinný', 'error');
@@ -1750,8 +1741,14 @@ async function saveApp(event) {
// Handle custom icon file upload if selected
const customIconInput = document.getElementById('customIconInput');
- if (customIconInput.files.length > 0) {
+ if (customIconInput && customIconInput.files.length > 0) {
formData.append('iconFile', customIconInput.files[0]);
+ } else {
+ // Make sure we have a valid icon class
+ if (!icon) {
+ showNotification('Vyberte prosím ikonu pro aplikaci', 'error');
+ return;
+ }
}
try {