Skip to content

Commit

Permalink
fix(usebattery): fix useBattery ios level async problem
Browse files Browse the repository at this point in the history
  • Loading branch information
innocces committed Aug 16, 2021
1 parent 8e4808e commit 5c3d937
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/hooks/src/useBattery/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getBatteryInfoSync, ENV_TYPE } from '@tarojs/taro';
import { getBatteryInfo, ENV_TYPE } from '@tarojs/taro';
import { useCallback, useEffect, useState } from 'react';
import useEnv from '../useEnv';

Expand Down Expand Up @@ -45,7 +45,7 @@ function useBattery(): IBatteryInfo {
};
}
} else {
battery = getBatteryInfoSync();
battery = await getBatteryInfo();
}
setBatteryInfo(battery as IBatteryInfo);
} catch (e) {
Expand Down

1 comment on commit 5c3d937

@vercel
Copy link

@vercel vercel bot commented on 5c3d937 Aug 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deployment failed with the following error:

The most recent charge for your active payment method has failed. Please update it here: https://vercel.com/teams/ff-docs/settings/billing.

Please sign in to comment.