Procházet zdrojové kódy

feat(Admin): Store last visited admin tab and reopen on next visit

Owen Diffey před 3 roky
rodič
revize
9cdb6f4ce1
1 změnil soubory, kde provedl 6 přidání a 1 odebrání
  1. 6 1
      frontend/src/pages/Admin/index.vue

+ 6 - 1
frontend/src/pages/Admin/index.vue

@@ -212,7 +212,11 @@ export default {
 					this.showTab("punishments");
 					break;
 				default:
-					this.showTab("verifiedsongs");
+					if (localStorage.getItem("lastAdminPage")) {
+						this.showTab(localStorage.getItem("lastAdminPage"));
+					} else {
+						this.showTab("verifiedsongs");
+					}
 			}
 		},
 		showTab(tab) {
@@ -222,6 +226,7 @@ export default {
 					block: "nearest"
 				});
 			this.currentTab = tab;
+			localStorage.setItem("lastAdminPage", tab);
 		}
 	}
 };