Skip to content

Commit

Permalink
Merge pull request #62 from SpringRoll/release/3.2.2
Browse files Browse the repository at this point in the history
Release 3.2.2
  • Loading branch information
902seanryan authored Mar 9, 2022
2 parents 768e1de + 81afcb4 commit b710b86
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 8 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [3.2.2] - 2021-03-09
## Fixed
- Add check to ensure target is not null before sending message in connectionRecieved method
- fixed error in debug logging always setting `recieved` to `false`

## Changed
- Changed console.error to console.warn when trying to parse JSON in postMessages to better reflect the behaviour

## [3.2.1] - 2021-10-07
### Added
- This CHANGELOG
Expand Down
2 changes: 1 addition & 1 deletion dist/bellhop-umd.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/bellhop-umd.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/bellhop.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/bellhop.js.map

Large diffs are not rendered by default.

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.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bellhop-iframe",
"version": "3.2.1",
"version": "3.2.2",
"main": "dist/bellhop.js",
"module": "dist/bellhop.js",
"browser": "dist/bellhop.js",
Expand Down
8 changes: 6 additions & 2 deletions src/Bellhop.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export class Bellhop extends BellhopEventDispatcher {
try {
data = JSON.parse(data);
} catch (err) {
console.error('Bellhop error: ', err);
console.warn('Bellhop error: ', err);
}
}
if (this.connected && 'object' === typeof data && data.type) {
Expand All @@ -140,6 +140,10 @@ export class Bellhop extends BellhopEventDispatcher {

// Be polite and respond to the child that we're ready
if (!this.isChild) {
// Timing issue: this.iframe.contentWindow is null when parent closes child iframe before done with rendering
if (!this.target) {
return;
}
this.target.postMessage(message, this.origin);
}

Expand Down Expand Up @@ -307,7 +311,7 @@ export class Bellhop extends BellhopEventDispatcher {
*/
logDebugMessage(received = false, message) {
if (this.debug && typeof this.debug === 'function') {
this.debug({ isChild: this.isChild, received: false, message: message });
this.debug({ isChild: this.isChild, received, message: message });
} else if (this.debug) {
console.log(
`Bellhop Instance (${this.isChild ? 'Child' : 'Parent'}) ${
Expand Down

0 comments on commit b710b86

Please sign in to comment.