Skip to content

Commit

Permalink
fix: use info as default instead of overview and add default to enabl…
Browse files Browse the repository at this point in the history
…eNavigation (#119)
  • Loading branch information
fraxken authored Sep 19, 2022
1 parent 1e0bef9 commit afadd16
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion public/js/components/package.info.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export class PackageInfo {
}

enableNavigation(name) {
const div = this.menus.get(name);
const div = this.menus.has(name) ? this.menus.get(name) : this.menus.get("info");

const isActive = div.classList.contains("active");
const isDisabled = div.classList.contains("disabled");
Expand Down
4 changes: 3 additions & 1 deletion public/js/components/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
import { getJSON } from "@nodesecure/vis-network";

export class Settings {
static defaultMenuName = "info";

constructor() {
this.saveEnabled = false;
this.dom = {
Expand Down Expand Up @@ -49,7 +51,7 @@ export class Settings {
}

const newConfig = {
defaultPackageMenu: this.dom.defaultPackageMenu.value,
defaultPackageMenu: this.dom.defaultPackageMenu.value || Settings.defaultMenuName,
ignore: { flags: [], warnings: [] }
};

Expand Down
2 changes: 1 addition & 1 deletion src/http-server/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export async function get() {
}
catch (error) {
const defaultValue = {
defaultPackageMenu: "overview",
defaultPackageMenu: "info",
ignore: { flags: [], warnings: [] }
};

Expand Down

0 comments on commit afadd16

Please sign in to comment.