Skip to content

Commit d8ede2f

Browse files
fix js query trigger on page load when used exposed variables are referred e.g. utils, toast, input1
1 parent 1b98505 commit d8ede2f

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

client/packages/lowcoder-core/lib/index.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1692,11 +1692,12 @@ class CodeNode extends AbstractNode {
16921692
// if query is dependent on itself, mark as ready
16931693
if (pathsArr?.[0] === options?.queryName)
16941694
return;
1695+
// TODO: check if this is needed after removing lazy load
16951696
// wait for lazy loaded comps to load before executing query on page load
1696-
if (value && !Object.keys(value).length && paths.size) {
1697-
isFetching = true;
1698-
ready = false;
1699-
}
1697+
// if (value && !Object.keys(value).length && paths.size) {
1698+
// isFetching = true;
1699+
// ready = false;
1700+
// }
17001701
if (_.has(value, IS_FETCHING_FIELD)) {
17011702
isFetching = isFetching || value.isFetching === true;
17021703
}

client/packages/lowcoder-core/src/eval/codeNode.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,11 +176,12 @@ export class CodeNode extends AbstractNode<ValueAndMsg<unknown>> {
176176
// if query is dependent on itself, mark as ready
177177
if (pathsArr?.[0] === options?.queryName) return;
178178

179+
// TODO: check if this is needed after removing lazy load
179180
// wait for lazy loaded comps to load before executing query on page load
180-
if (value && !Object.keys(value).length && paths.size) {
181-
isFetching = true;
182-
ready = false;
183-
}
181+
// if (value && !Object.keys(value).length && paths.size) {
182+
// isFetching = true;
183+
// ready = false;
184+
// }
184185
if (_.has(value, IS_FETCHING_FIELD)) {
185186
isFetching = isFetching || value.isFetching === true;
186187
}

client/packages/lowcoder/src/comps/queries/queryComp.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ function QueryView(props: QueryViewProps) {
335335
) {
336336
setTimeout(() => {
337337
comp.dispatch(deferAction(executeQueryAction({})));
338-
}, 300);
338+
}, 600);
339339
}
340340

341341
if(getTriggerType(comp) === "onTimeout") {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy