// Enabled implements the api.Charger interface
Enabled implements the api.Charger interface
// Enabled implements the api . Charger interface
func (wb *Warp) Enabled() (bool, error) {
	enabled, err := wb.isEnabled()
	if err == nil && enabled != wb.enabled {
		start := time.Now()
		for time.Since(start) <= 2*time.Second {
			if enabled, err = wb.isEnabled(); err != nil {
				break
			}
			if enabled == wb.enabled {
				break
			}
			time.Sleep(50 * time.Millisecond)
		}
	}
	return enabled, err
}
func ( wb * Warp ) Enabled ( ) ( bool , error ) { enabled , err := wb . isEnabled ( ) if err == nil && enabled != wb . enabled { start := time . Now ( ) for time . Since ( start ) <= 2 * time . Second { if enabled , err = wb . isEnabled ( ) ; err != nil { break } if enabled == wb . enabled { break } time . Sleep ( 50 * time . Millisecond ) } } return enabled , err }
Enabled implements the api.Charger interface
Enabled implements the api . Charger interface
// retry to avoid out of sync errors in case of slow warp updates