Skip to content

Commit

Permalink
fix: added placeholder to the disks list in the popup settings when n…
Browse files Browse the repository at this point in the history
…o disks show because the module is disabled (#2383)
  • Loading branch information
exelban committed Feb 7, 2025
1 parent f9b522a commit 8588161
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Modules/Disk/popup.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 8588161

Please sign in to comment.