Skip to content

Commit 92d384e

Browse files
committed
refactor: remove unnecessary await
1 parent d962619 commit 92d384e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/taro-h5/src/api/base/system.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,12 +179,12 @@ export const getSystemInfoSync: typeof Taro.getSystemInfoSync = () => {
179179
}
180180

181181
/** 获取系统信息 */
182-
export const getSystemInfoAsync: typeof Taro.getSystemInfoAsync = async (options = {}) => {
182+
export const getSystemInfoAsync: typeof Taro.getSystemInfoAsync = async (options: Taro.getSystemInfoAsync.Option = {}) => {
183183
const { success, fail, complete } = options
184184
const handle = new MethodHandler({ name: 'getSystemInfoAsync', success, fail, complete })
185185

186186
try {
187-
const info = await getSystemInfoSync()
187+
const info = getSystemInfoSync()
188188
return handle.success(info)
189189
} catch (error) {
190190
return handle.fail({
@@ -194,12 +194,12 @@ export const getSystemInfoAsync: typeof Taro.getSystemInfoAsync = async (options
194194
}
195195

196196
/** 获取系统信息 */
197-
export const getSystemInfo: typeof Taro.getSystemInfo = async (options = {}) => {
197+
export const getSystemInfo: typeof Taro.getSystemInfo = async (options: Taro.getSystemInfo.Option = {}) => {
198198
const { success, fail, complete } = options
199199
const handle = new MethodHandler({ name: 'getSystemInfo', success, fail, complete })
200200

201201
try {
202-
const info = await getSystemInfoSync()
202+
const info = getSystemInfoSync()
203203
return handle.success(info)
204204
} catch (error) {
205205
return handle.fail({

0 commit comments

Comments
 (0)