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 { sessionStore } from '@/stores/session'
|
||||
import { createResource } from 'frappe-ui'
|
||||
import { reactive, ref } from 'vue'
|
||||
|
||||
@ -7,9 +6,6 @@ export const viewsStore = defineStore('crm-views', (doctype) => {
|
||||
let viewsByName = reactive({})
|
||||
let pinnedViews = ref([])
|
||||
let publicViews = ref([])
|
||||
let defaultView = ref(null)
|
||||
|
||||
const { user } = sessionStore()
|
||||
|
||||
// Views
|
||||
const views = createResource({
|
||||
@ -29,16 +25,6 @@ export const viewsStore = defineStore('crm-views', (doctype) => {
|
||||
if (view.public) {
|
||||
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
|
||||
},
|
||||
@ -59,10 +45,6 @@ export const viewsStore = defineStore('crm-views', (doctype) => {
|
||||
return publicViews.value
|
||||
}
|
||||
|
||||
function getDefaultView() {
|
||||
return defaultView.value
|
||||
}
|
||||
|
||||
async function reload() {
|
||||
await views.reload()
|
||||
}
|
||||
@ -71,7 +53,6 @@ export const viewsStore = defineStore('crm-views', (doctype) => {
|
||||
views,
|
||||
getPinnedViews,
|
||||
getPublicViews,
|
||||
getDefaultView,
|
||||
reload,
|
||||
getView,
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user