Skip to content

Commit

Permalink
Merge pull request #1496 from pazdera/prod-fix
Browse files Browse the repository at this point in the history
Further fix for the share flow
  • Loading branch information
pazdera authored Apr 5, 2018
2 parents 03ed4eb + ab0902e commit 62468fd
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions app/elements/kano-app-player/kano-app-player.html
Original file line number Diff line number Diff line change
Expand Up @@ -144,14 +144,16 @@ <h1 class="error">Something went wrong :(</h1>
}
},
_srcChanged () {
// Check that we are loading and html file. Bsing that on the extension is not the best solution
// as any server coulde return html content. This prevents loading of late setups bindings. For
// exanple, Vue.js will set the property to {{item.attachment_url}} a few times before applying the binding

if (!this.src || !/(.*\.html)|(data:text\/html;base64,.*)/.test(this.src)) {
return;
}
this.debounce('importApp', () => {
// Check that we are loading and html file. Bsing that on the extension is not the best solution
// as any server coulde return html content. This prevents loading of late setups bindings. For
// exanple, Vue.js will set the property to {{item.attachment_url}} a few times before applying the binding

// This check needs to happen within the debounce otherwise an incorrect object may be loaded.
if (!this.src || !/(.*\.html)|(data:text\/html;base64,.*)/.test(this.src)) {
return;
}

this.importHref(this.src, this._onAppFileLoad.bind(this), this._onAppFileError.bind(this));
});
},
Expand Down

0 comments on commit 62468fd

Please sign in to comment.