Bug 1499049 - (Part 8) Clear the changes store when about to navigate to a new page; r=pbro
authorRazvan Caliman <rcaliman@mozilla.com>
Thu, 25 Oct 2018 08:07:40 +0000
changeset 443108 629deef4613c09a0f081fc804507355b250aab77
parent 443107 c4f23d37432644acf51200bb418a5029e66b0a68
child 443109 d0c4e1db970ef48154e77ae540f8bc71b1431ed1
push id34939
push usernerli@mozilla.com
push dateFri, 26 Oct 2018 15:47:55 +0000
treeherdermozilla-central@760a16bf0d2b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspbro
bugs1499049
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1499049 - (Part 8) Clear the changes store when about to navigate to a new page; r=pbro Depends on D9257 We need to clear the store of previous changes but we should not remove references and event listeners to the ChangesActor since the DevTools session is still active. MozReview-Commit-ID: Okp2CcSlfw Differential Revision: https://phabricator.services.mozilla.com/D9659
devtools/client/inspector/changes/ChangesView.js
--- a/devtools/client/inspector/changes/ChangesView.js
+++ b/devtools/client/inspector/changes/ChangesView.js
@@ -39,19 +39,17 @@ class ChangesView {
 
     // Expose the provider to let inspector.js use it in setupSidebar.
     this.provider = createElement(Provider, {
       id: "changesview",
       key: "changesview",
       store: this.store,
     }, changesApp);
 
-    // TODO: save store and restore/replay on refresh.
-    // Bug 1478439 - https://bugzilla.mozilla.org/show_bug.cgi?id=1478439
-    this.inspector.target.once("will-navigate", this.destroy);
+    this.inspector.target.on("will-navigate", this.onClearChanges);
 
     // Sync the store to the changes stored on the server. The
     // syncChangesToServer() method is async, but we don't await it since
     // this method itself is NOT async. The call will be made in its own
     // time, which is fine since it definitionally brings us up-to-date
     // with the server at that moment.
     this.syncChangesToServer();
   }