Skip to content

Commit

Permalink
fix(root): 修复 timeout 失效问题
Browse files Browse the repository at this point in the history
这会带来一个问题,自定义的 callback 永远会执行,因为 timeout 为 undefined ,一定会在唤端之前执行 callback

Closes #4
  • Loading branch information
suanmei committed Oct 15, 2018
1 parent 00d5e84 commit 22b01b5
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dist/index.umd.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions index.js
Expand Up @@ -16,7 +16,8 @@ class CallApp {
* @memberof CallApp
*/
constructor(options) {
this.options = options || {};
const defaultOptions = { timeout: 2000 };
this.options = Object.assign(defaultOptions, options);
}

/**
Expand Down Expand Up @@ -49,7 +50,7 @@ class CallApp {
if (!hidden) {
cb();
}
}, this.timeout);
}, this.options.timeout);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "callapp-lib",
"version": "1.6.3",
"version": "1.6.4",
"description": "call native webview from webpage",
"main": "dist/index.umd.js",
"scripts": {
Expand Down Expand Up @@ -44,6 +44,7 @@
"babel-plugin-external-helpers": "^6.22.0",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-env": "^1.7.0",
"babel-runtime": "^6.26.0",
"eslint": "^4.19.1",
"eslint-config-airbnb-base": "^12.1.0",
"eslint-plugin-import": "^2.13.0",
Expand Down

0 comments on commit 22b01b5

Please sign in to comment.