Skip to content

Commit

Permalink
fix: Search works only from second time (#23, #24) (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
gromdimon authored Sep 1, 2023
1 parent 586af7e commit 4ca6249
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 25 deletions.
13 changes: 0 additions & 13 deletions frontend/src/components/HeaderDetailPage.vue
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
<script setup lang="ts">
import { useRouter } from 'vue-router'
import { useGeneInfoStore } from '@/stores/geneInfo'
const router = useRouter()
const geneInfoStore = useGeneInfoStore()
if (geneInfoStore.geneInfo === null) {
router.push({ name: 'home' })
}
</script>

<template>
<v-app-bar app class="top-bar">
<v-toolbar-title>
Expand Down
11 changes: 0 additions & 11 deletions frontend/src/components/__tests__/HeaderDetailPage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,4 @@ describe('HeaderDetailPage', async () => {
expect(aboutLink.exists()).toBe(true)
expect(contactLink.exists()).toBe(true)
})

it('redirects if gene data is null', async () => {
const store = useGeneInfoStore()
store.storeState = StoreState.Initial
store.geneSymbol = null
store.geneInfo = null

makeWrapper()

expect(router.push).toHaveBeenCalled()
})
})
2 changes: 1 addition & 1 deletion frontend/src/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const router = createRouter({
/** The default page title */
const DEFAULT_TITLE = 'REEV Explains and Evaluates Variants'

router.afterEach((to, _from) => {
router.afterEach((to) => {
// Use next tick to handle router history correctly
// see: https://github.com/vuejs/vue-router/issues/914#issuecomment-384477609
nextTick(() => {
Expand Down

0 comments on commit 4ca6249

Please sign in to comment.