Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
-->

## [Unreleased]
### Fixed
- Fix [#160](https://github.com/Microsoft/BotFramework-DirectLineJS/issues/160). Removed warning if `pollingInterval` is `undefined`, by [@compulim](https://github.com/compulim) in PR [#161](https://github.com/Microosft/BotFramework-DirectLineJS/pull/161)

## [0.11.2] - 2019-02-05
### Fixed
Expand Down
4 changes: 3 additions & 1 deletion src/directLine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,9 @@ export class DirectLine implements IBotConnection {
const parsedPollingInterval = ~~options.pollingInterval;

if (parsedPollingInterval < POLLING_INTERVAL_LOWER_BOUND) {
console.warn(`DirectLineJS: provided pollingInterval (${ options.pollingInterval }) is under lower bound (200ms), using default of 1000ms`);
if (typeof options.pollingInterval !== 'undefined') {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why typeof, and not just options.pollingInterval === undefined?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is a JS idiom used because in some cases the identifier being check may not have been initialized yet. That's not the case here, but it doesn't hurt using typeof.

console.warn(`DirectLineJS: provided pollingInterval (${ options.pollingInterval }) is under lower bound (200ms), using default of 1000ms`);
}
} else {
this.pollingInterval = parsedPollingInterval;
}
Expand Down