Skip to content

Commit

Permalink
r.syncedSessionStorage: Get values from e.originalEvent
Browse files Browse the repository at this point in the history
The jQuery event doesn't expose the storage key or newValue attributes.
  • Loading branch information
Matt Lee committed Oct 7, 2016
1 parent e946fa3 commit ad69953
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions r2/r2/public/static/js/synced-session-storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@

$(window).on('storage', function(e) {
// the localStorage.removeItem will come in with a null newValue
if (e.key === SYNC_EVENT_KEY && e.newValue) {
var event = JSON.parse(e.newValue);
if (e.originalEvent.key === SYNC_EVENT_KEY && e.originalEvent.newValue) {
var event = JSON.parse(e.originalEvent.newValue);
this._handleSync(event);
}
}.bind(this));
Expand Down

0 comments on commit ad69953

Please sign in to comment.