Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ui/src/components/AppBar/AppBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ const userId = computed(() => authStore.id);
const currentUser = computed(() => authStore.username);
const isBillingActive = computed(() => billingStore.isActive);
const theme = computed(() => layoutStore.theme);
const hasNamespaces = computed(() => namespacesStore.namespaceList.length > 0);
const hasNamespaces = computed(() => namespacesStore.hasNamespaces);
const isChatCreated = computed(() => supportStore.isChatCreated);
const identifier = computed(() => supportStore.identifier);
const isDarkMode = ref(theme.value === "dark");
Expand Down
2 changes: 1 addition & 1 deletion ui/src/components/Namespace/Namespace.vue
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ const showAddDialog = ref(false);

const currentNamespace = computed(() => namespacesStore.currentNamespace);
const namespaceList = computed(() => namespacesStore.namespaceList);
const hasNamespaces = computed(() => namespacesStore.namespaceList.length > 0);
const hasNamespaces = computed(() => namespacesStore.hasNamespaces);
const showInstructionsDialog = ref(false);
const userId = computed(() => authStore.id || localStorage.getItem("id") || "");

Expand Down
3 changes: 1 addition & 2 deletions ui/src/components/User/UserDelete.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ import useAuthStore from "@/store/modules/auth";
import useNamespacesStore from "@/store/modules/namespaces";

const authStore = useAuthStore();
const { namespaceList } = useNamespacesStore();
const hasNamespaces = namespaceList.length > 0;
const { hasNamespaces } = useNamespacesStore();
const snackbar = useSnackbar();
const router = useRouter();
const showDialog = defineModel<boolean>({ default: false });
Expand Down
2 changes: 1 addition & 1 deletion ui/src/components/User/UserWarning.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const showForceRecoveryMail = computed(() => authStore.showForceRecoveryMail);
const showPaywall = computed(() => usersStore.showPaywall);
const stats = computed(() => statsStore.stats);
const currentAnnouncement = computed(() => announcementStore.currentAnnouncement);
const hasNamespaces = computed(() => namespacesStore.namespaceList.length > 0);
const hasNamespaces = computed(() => namespacesStore.hasNamespaces);
const showDeviceChooser = computed(() => devicesStore.showDeviceChooser);
const showBillingWarning = computed({
get() {
Expand Down
2 changes: 1 addition & 1 deletion ui/src/layouts/AppLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ const namespacesStore = useNamespacesStore();
const spinnerStore = useSpinnerStore();
const { getPrivateKeyList } = usePrivateKeysStore();
const currentRoute = computed(() => router.currentRoute);
const hasNamespaces = computed(() => namespacesStore.namespaceList.length !== 0);
const hasNamespaces = computed(() => namespacesStore.hasNamespaces);
const theme = computed(() => layoutStore.theme);

const { lgAndUp } = useDisplay();
Expand Down
4 changes: 3 additions & 1 deletion ui/src/store/modules/namespaces.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineStore } from "pinia";
import { ref } from "vue";
import { computed, ref } from "vue";
import * as namespacesApi from "../api/namespaces";
import {
INamespace,
Expand All @@ -14,6 +14,7 @@ const useNamespacesStore = defineStore("namespaces", () => {
const currentNamespace = ref<INamespace>({} as INamespace);
const namespaceList = ref<Array<INamespace>>([]);
const userStatus = ref<string>();
const hasNamespaces = computed(() => namespaceList.value.length > 0);

const fetchNamespaceList = async (data?: { page?: number; perPage?: number; filter?: string }) => {
const res = await namespacesApi.fetchNamespaces(data?.page || 1, data?.perPage || 10, data?.filter);
Expand Down Expand Up @@ -99,6 +100,7 @@ const useNamespacesStore = defineStore("namespaces", () => {
currentNamespace,
namespaceList,
userStatus,
hasNamespaces,

createNamespace,
fetchNamespaceList,
Expand Down