Skip to content

Commit

Permalink
fix: loop elements block
Browse files Browse the repository at this point in the history
  • Loading branch information
Kholid060 committed Sep 21, 2022
1 parent 20cb793 commit 519799c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 27 deletions.
2 changes: 1 addition & 1 deletion src/background/workflowEngine/engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ class WorkflowEngine {
const { settings: userSettings } = await browser.storage.local.get(
'settings'
);
this.logsLimit = userSettings.logsLimit || 1001;
this.logsLimit = userSettings?.logsLimit || 1001;

this.workflow.table = columns;
this.startedTimestamp = Date.now();
Expand Down
19 changes: 0 additions & 19 deletions src/components/newtab/workflow/edit/EditTrigger.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,6 @@
class="w-full mb-2"
@change="updateData({ description: $event })"
/>
<!-- <ui-select
:model-value="data.type || 'manual'"
:placeholder="t('workflow.blocks.trigger.forms.triggerWorkflow')"
class="w-full"
@change="updateData({ type: $event })"
>
<option v-for="(_, trigger) in triggers" :key="trigger" :value="trigger">
{{ t(`workflow.blocks.trigger.items.${trigger}`) }}
</option>
</ui-select>
<transition-expand mode="out-in">
<keep-alive>
<component
:is="triggers[data.type]?.component"
:data="data"
@update="updateData"
/>
</keep-alive>
</transition-expand> -->
<ui-button
variant="accent"
class="w-full mt-4"
Expand Down
11 changes: 4 additions & 7 deletions src/content/blocksHandler/handlerLoopElements.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,14 @@ export default async function ({ data, id }) {
const scrollableParent = getScrollParent(loopItems[0]);
if (!scrollableParent) return { continue: true };

let scrollHeight = 0;
if (data.scrollToBottom) {
scrollHeight = scrollableParent.scrollHeight;
const { scrollHeight } = scrollableParent;
scrollableParent.scrollTo(0, scrollHeight + 30);
} else {
loopItems.forEach((item) => {
scrollHeight += item.getBoundingClientRect().height;
});
const lastElement = loopItems[loopItems.length - 1];
lastElement.scrollIntoView();
}

scrollableParent.scrollTo(0, scrollHeight + 30);

await sleep(500);

elements = await handleSelector(getNewElementsOptions);
Expand Down

0 comments on commit 519799c

Please sign in to comment.