Skip to content

Commit

Permalink
fix(useBattery): fake signal API support in some utilities (#3634)
Browse files Browse the repository at this point in the history
Co-authored-by: Doctorwu <44631608+Doctor-wu@users.noreply.github.com>
  • Loading branch information
tachibana-shin and Doctor-wu committed Jan 9, 2024
1 parent 37eaea3 commit 3024511
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/core/useBattery/index.ts
Expand Up @@ -26,7 +26,7 @@ export function useBattery(options: ConfigurableNavigator = {}) {
const { navigator = defaultNavigator } = options
const events = ['chargingchange', 'chargingtimechange', 'dischargingtimechange', 'levelchange']

const isSupported = useSupported(() => navigator && 'getBattery' in navigator)
const isSupported = useSupported(() => navigator && 'getBattery' in navigator && typeof navigator.getBattery === 'function')

const charging = ref(false)
const chargingTime = ref(0)
Expand Down

0 comments on commit 3024511

Please sign in to comment.