fix: added placeholder to the disks list in the popup settings when no disks show because the module is disabled (#2383)

This commit is contained in:
Serhiy Mytrovtsiy
2025-02-07 21:21:34 +01:00
parent f9b522aeb3
commit 858816107a

View File

@@ -107,6 +107,10 @@ internal class Popup: PopupWrapper {
self.lastList = value.array.compactMap{ $0.uuid }
}
if self.settingsSection.contains("empty_view") {
self.settingsSection.delete("empty_view")
}
self.lastList.filter { !value.map { $0.uuid }.contains($0) }.forEach { self.settingsSection.delete($0) }
value.forEach { (drive: drive) in
if !self.settingsSection.contains(drive.uuid) {
@@ -216,6 +220,9 @@ internal class Popup: PopupWrapper {
))
]))
let empty = NSView()
empty.identifier = NSUserInterfaceItemIdentifier("empty_view")
self.settingsSection.add(empty)
view.addArrangedSubview(self.settingsSection)
return view