fix: removed default view logic from views.js
This commit is contained in:
parent
38f2d75816
commit
cf481889bd
@ -1,5 +1,4 @@
|
|||||||
import { defineStore } from 'pinia'
|
import { defineStore } from 'pinia'
|
||||||
import { sessionStore } from '@/stores/session'
|
|
||||||
import { createResource } from 'frappe-ui'
|
import { createResource } from 'frappe-ui'
|
||||||
import { reactive, ref } from 'vue'
|
import { reactive, ref } from 'vue'
|
||||||
|
|
||||||
@ -7,9 +6,6 @@ export const viewsStore = defineStore('crm-views', (doctype) => {
|
|||||||
let viewsByName = reactive({})
|
let viewsByName = reactive({})
|
||||||
let pinnedViews = ref([])
|
let pinnedViews = ref([])
|
||||||
let publicViews = ref([])
|
let publicViews = ref([])
|
||||||
let defaultView = ref(null)
|
|
||||||
|
|
||||||
const { user } = sessionStore()
|
|
||||||
|
|
||||||
// Views
|
// Views
|
||||||
const views = createResource({
|
const views = createResource({
|
||||||
@ -29,16 +25,6 @@ export const viewsStore = defineStore('crm-views', (doctype) => {
|
|||||||
if (view.public) {
|
if (view.public) {
|
||||||
publicViews.value?.push(view)
|
publicViews.value?.push(view)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
|
||||||
(!view.public && view.default) ||
|
|
||||||
(view.public &&
|
|
||||||
view.default &&
|
|
||||||
view.user_list &&
|
|
||||||
JSON.parse(view.user_list).includes(user))
|
|
||||||
) {
|
|
||||||
defaultView.value = view
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return views
|
return views
|
||||||
},
|
},
|
||||||
@ -59,10 +45,6 @@ export const viewsStore = defineStore('crm-views', (doctype) => {
|
|||||||
return publicViews.value
|
return publicViews.value
|
||||||
}
|
}
|
||||||
|
|
||||||
function getDefaultView() {
|
|
||||||
return defaultView.value
|
|
||||||
}
|
|
||||||
|
|
||||||
async function reload() {
|
async function reload() {
|
||||||
await views.reload()
|
await views.reload()
|
||||||
}
|
}
|
||||||
@ -71,7 +53,6 @@ export const viewsStore = defineStore('crm-views', (doctype) => {
|
|||||||
views,
|
views,
|
||||||
getPinnedViews,
|
getPinnedViews,
|
||||||
getPublicViews,
|
getPublicViews,
|
||||||
getDefaultView,
|
|
||||||
reload,
|
reload,
|
||||||
getView,
|
getView,
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user