Fixed the auto-hide functionality for the media bar module. (#588)
This commit is contained in:
@@ -2,13 +2,11 @@ import { bind, Variable } from 'astal';
|
||||
import { networkService } from 'src/lib/constants/services';
|
||||
|
||||
export const isWifiEnabled: Variable<boolean> = Variable(false);
|
||||
let wifiEnabledBinding: Variable<void>;
|
||||
let wifiEnabledBinding: Variable<void> | undefined;
|
||||
|
||||
Variable.derive([bind(networkService, 'wifi')], () => {
|
||||
if (wifiEnabledBinding) {
|
||||
wifiEnabledBinding();
|
||||
wifiEnabledBinding.drop();
|
||||
}
|
||||
wifiEnabledBinding?.drop();
|
||||
wifiEnabledBinding = undefined;
|
||||
|
||||
if (!networkService.wifi) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user