Skip to content

Commit

Permalink
Merge pull request #15 from capJavert/fix/data-clone-error
Browse files Browse the repository at this point in the history
Make sure plain object is passed to sendMessage
  • Loading branch information
capJavert authored Aug 29, 2019
2 parents 4319872 + 616f78c commit 2c296d7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/assets/js/state.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,16 @@ const loadComments = () => {

xhttp.onreadystatechange = () => {
if (xhttp.readyState === 4 && xhttp.status === 200) {
settings.comments = JSON.parse(xhttp.response)
const comments = JSON.parse(xhttp.response)
settings.comments = comments

browser.tabs.query({}, (tabs) => {
tabs.forEach((tab, index) => {
browser.tabs.sendMessage(
tabs[index].id,
{
name: 'comments',
value: settings.comments
value: comments
}
)
})
Expand Down

0 comments on commit 2c296d7

Please sign in to comment.