mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-24 20:36:40 +07:00
set default node count on flow to 20
This commit is contained in:
parent
e2ffdcd1f2
commit
4ded317fd0
1 changed files with 8 additions and 3 deletions
|
@ -19,6 +19,7 @@ export const useFlowLoader = () => {
|
|||
const { before, after, heroes, recent, updated } = await getNodeDiff({
|
||||
start: new Date().toISOString(),
|
||||
end: new Date().toISOString(),
|
||||
take: 20,
|
||||
with_heroes: true,
|
||||
with_updated: true,
|
||||
with_recent: true,
|
||||
|
@ -45,7 +46,9 @@ export const useFlowLoader = () => {
|
|||
setIsSyncing(true);
|
||||
|
||||
const start = flow.nodes[0].created_at;
|
||||
const end = flow.nodes[flow.nodes.length - 1] && flow.nodes[flow.nodes.length - 1].created_at;
|
||||
const end =
|
||||
flow.nodes[flow.nodes.length - 1] &&
|
||||
flow.nodes[flow.nodes.length - 1].created_at;
|
||||
|
||||
const data = await getNodeDiff({
|
||||
start,
|
||||
|
@ -58,7 +61,9 @@ export const useFlowLoader = () => {
|
|||
|
||||
const nodes = uniq([
|
||||
...(data.before || []),
|
||||
...(data.valid ? flow.nodes.filter(node => data.valid.includes(node.id)) : flow.nodes),
|
||||
...(data.valid
|
||||
? flow.nodes.filter((node) => data.valid.includes(node.id))
|
||||
: flow.nodes),
|
||||
...(data.after || []),
|
||||
]);
|
||||
|
||||
|
@ -75,7 +80,7 @@ export const useFlowLoader = () => {
|
|||
});
|
||||
|
||||
// wait a little to debounce
|
||||
await new Promise(resolve => setTimeout(resolve, 1000));
|
||||
await new Promise((resolve) => setTimeout(resolve, 1000));
|
||||
} catch (error) {
|
||||
showErrorToast(error);
|
||||
} finally {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue