Bunn / PiStats

macOS app to visualize Pi-hole information
BSD 2-Clause "Simplified" License
374 stars 12 forks source link

Unnecessary check if API key exists to display the disable button #38

Open johnflan opened 2 years ago

johnflan commented 2 years ago

The app has logic (below) to only display the enable button if an API key is set. I use PiHole without a password (and thus without an API key), in this mode you don't require sending an API key to the interface to disable PiHole.

var canDisplayEnableDisableButton: Bool { return !piholes.allSatisfy { return $0.apiToken.isEmpty == true } }

I have removed this check and tested it locally and it behaves properly.