fix: reload Link on filters change
This commit is contained in:
parent
5feaddcd6f
commit
19c69d1495
@ -127,6 +127,14 @@ watchDebounced(
|
|||||||
{ debounce: 300, immediate: true },
|
{ debounce: 300, immediate: true },
|
||||||
)
|
)
|
||||||
|
|
||||||
|
watchDebounced(
|
||||||
|
() => props.filters,
|
||||||
|
() => {
|
||||||
|
reload('', true)
|
||||||
|
},
|
||||||
|
{ debounce: 300, immediate: true },
|
||||||
|
)
|
||||||
|
|
||||||
const options = createResource({
|
const options = createResource({
|
||||||
url: 'frappe.desk.search.search_link',
|
url: 'frappe.desk.search.search_link',
|
||||||
cache: [props.doctype, text.value, props.hideMe, props.filters],
|
cache: [props.doctype, text.value, props.hideMe, props.filters],
|
||||||
@ -154,13 +162,14 @@ const options = createResource({
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
function reload(val) {
|
function reload(val, force=false) {
|
||||||
if (!props.doctype) return
|
if (!props.doctype) return
|
||||||
if (
|
if (
|
||||||
|
!force &&
|
||||||
options.data?.length &&
|
options.data?.length &&
|
||||||
val === options.params?.txt &&
|
val === options.params?.txt &&
|
||||||
props.doctype === options.params?.doctype
|
props.doctype === options.params?.doctype
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
options.update({
|
options.update({
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user