Skip to content

Commit

Permalink
fix(kb): Require account connected to access page
Browse files Browse the repository at this point in the history
  • Loading branch information
RezaRahemtola committed Sep 5, 2024
1 parent e258d2f commit 0339f55
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/pages/KnowledgeBasesList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,31 @@
</template>

<script lang="ts" setup>
import { ref } from 'vue';
import { onMounted, ref } from 'vue';
import KnowledgeBaseCreationDialog from 'components/dialog/KnowledgeBaseCreationDialog.vue';
import { useKnowledgeStore } from 'stores/knowledge';
import LtaiIcon from 'components/libertai/LtaiIcon.vue';
import dayjs from 'dayjs';
import { useAccount } from '@wagmi/vue';
import { useQuasar } from 'quasar';
import { useRouter } from 'vue-router';
const $q = useQuasar();
const router = useRouter();
const account = useAccount();
const knowledgeStore = useKnowledgeStore();
const createKnowledgeDialog = ref(false);
onMounted(async () => {
if (!account.isConnected.value) {
$q.notify({ message: 'Account not connected', color: 'negative' });
await router.push({ path: '/' });
return;
}
});
const createKnowledgeBase = (name: string) => {
knowledgeStore.createKnowledgeBase(name);
};
Expand Down

0 comments on commit 0339f55

Please sign in to comment.