Skip to content

Commit

Permalink
if config.require_login: true, do not show panels
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmedhamidawan committed Feb 22, 2024
1 parent 8c77b9d commit 83ca1a5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions client/src/composables/usePanels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,19 @@ import { useRoute } from "vue-router/composables";

import { useUserStore } from "@/stores/userStore";

import { useConfig } from "./config";

export function usePanels() {
const userStore = useUserStore();
const route = useRoute();
const { config, isConfigLoaded } = useConfig();

const showPanels = computed(() => {
const panels = route.query.hide_panels;
if (panels !== undefined && panels !== null && typeof panels === "string") {
return panels.toLowerCase() != "true";
} else if (isConfigLoaded.value && config.value.require_login === true) {
return false;
}
return true;
});
Expand Down

0 comments on commit 83ca1a5

Please sign in to comment.