ementById('caseDevicesModal');
                    const addDeviceModal = document.getElementById('addDeviceToCaseModal');
                    
                    if (caseDevicesModal && caseDevicesModal.style.display === 'flex') {
                        refreshCaseDevicesModal(caseID);
                    }
                    
                    if (addDeviceModal && addDeviceModal.style.display !== 'none') {
                        showAddDeviceToCase(caseID);
                    }
                   