Skip to content

Commit

Permalink
fix: navigating back and forth breaks reactivity
Browse files Browse the repository at this point in the history
  • Loading branch information
nextchamp-saqib committed Jan 22, 2024
1 parent 0d19641 commit 24f72db
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 19 deletions.
9 changes: 0 additions & 9 deletions frontend/src/query/resources/useQuery.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,7 @@ import useQueryResults from './useQueryResults'

const session = sessionStore()

const queries = {}

export default function useQuery(name) {
if (!queries[name]) {
queries[name] = makeQuery(name)
}
return queries[name]
}

function makeQuery(name) {
const resource = useQueryResource(name)
const state = reactive({
loading: true,
Expand Down
11 changes: 1 addition & 10 deletions frontend/src/query/resources/useQueryResults.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,7 @@ import { createDocumentResource } from 'frappe-ui'
import { computed, reactive } from 'vue'
import { getFormattedResult } from '@/utils/query/results'

const queryResults = {}

export default function useQueryResults(name) {
if (!queryResults[name]) {
queryResults[name] = makeQueryResults(name)
}
return queryResults[name]
}

function makeQueryResults(result_name) {
export default function useQueryResults(result_name) {
const resource = getResultResource(result_name)
resource.get.fetch()
return reactive({
Expand Down

0 comments on commit 24f72db

Please sign in to comment.