LP1936233 Default to list if no item ID present
authorBill Erickson <berickxx@gmail.com>
Wed, 4 Aug 2021 17:09:05 +0000 (13:09 -0400)
committerBill Erickson <berickxx@gmail.com>
Mon, 24 Oct 2022 15:07:24 +0000 (11:07 -0400)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/eg2/src/app/staff/cat/item/status.component.ts

index f9a9dac..f4032a7 100644 (file)
@@ -178,12 +178,18 @@ export class ItemStatusComponent implements OnInit, AfterViewInit {
             // Avoid watching for changes until after ngOnInit is complete
             // so we don't grab the same copy twice.
             this.route.paramMap.subscribe((params: ParamMap) => {
-                this.tab = params.get('tab') || 'summary';
+                this.tab = params.get('tab');
                 const id = +params.get('id');
 
-                if (id && id !== this.currentItemId) {
-                    this.currentItemId = id;
-                    this.getItemById(id);
+                if (id) {
+                    if (!this.tab) { this.tab = 'summary'; }
+
+                    if (id !== this.currentItemId) {
+                        this.currentItemId = id;
+                        this.getItemById(id);
+                    }
+                } else if (!this.tab) {
+                    this.tab = 'list';
                 }
             });
         });