diff --git a/app/components/nav/sidebar.hbs b/app/components/nav/sidebar.hbs
index 11798af2a6457b6a63bb356ac76d600ce3f5dfdc..7af7a15f299a02ad92629bad1cdd9f64aaef6d52 100644
--- a/app/components/nav/sidebar.hbs
+++ b/app/components/nav/sidebar.hbs
@@ -16,6 +16,7 @@
           <LinkTo
             @route="authenticated.nodes"
             @model="{{@home_folder_id}}"
+            @query={{hash extra_id=null extra_type=null}}
             class="nav-link text-white" aria-current="page">
             <i class="fa fa-home me-2"></i>Home
           </LinkTo>
@@ -41,6 +42,7 @@
           <LinkTo
             @route="authenticated.nodes"
             @model="{{@inbox_folder_id}}"
+            @query={{hash extra_id=null extra_type=null}}
             class="nav-link text-white" aria-current="page">
             <i class="bi-inbox me-2"></i>Inbox ({{@inbox_count}})
           </LinkTo>
diff --git a/app/controllers/authenticated/document.js b/app/controllers/authenticated/document.js
index dd8f26951f4042ec7190b14443ee05c31253ea91..162cb64d29e72bf6c223b156d475812cff4ba293 100644
--- a/app/controllers/authenticated/document.js
+++ b/app/controllers/authenticated/document.js
@@ -13,20 +13,40 @@ export default class DocumentController extends DualPanelBaseController {
       hint is either "left" or "right" depending where
       the onPanelToggle originated from.
     */
-    let home_folder;
+    let home_folder,
+      route,
+      empty_query_params,
+      extra_id,
+      extra_type,
+      doc_id;
 
-    if (this.extra_id) {
+    route = this.router.currentRoute;
+    empty_query_params = {
+      'queryParams': {}
+    };
+    doc_id = route.params.document_id;
+
+    if (route.queryParams.extra_id) {
+      extra_id = route.queryParams.extra_id;
+      extra_type = route.queryParams.extra_type;
       if (hint === "left") {
         // user decided to close left panel
-        if (this.extra_type === 'folder') {
-          this.replaceRoute('authenticated.nodes', this.extra_id);
+        if (extra_type === 'folder') {
+          this.router.transitionTo(
+            'authenticated.nodes',
+            extra_id,
+            empty_query_params
+          );
         } else {
-          this.replaceRoute('authenticated.document', this.extra_id);
+          this.router.transitionTo(
+            'authenticated.document',
+            doc_id,
+            empty_query_params
+          );
+          this.extra_id = null;
+          this.extra_type = null;
         }
-        this.extra_id = null;
-        this.extra_type = null;
       } else if (hint === "right") {
-        console.log('Closing right panel');
         this.extra_id = null;
         this.extra_type = null;
       } else {