Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
baruchiro committed Nov 10, 2024
1 parent 12c69ea commit 55b0148
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
12 changes: 7 additions & 5 deletions packages/main/src/backend/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,14 @@ export async function scrapeAndUpdateOutputVendors(config: Config, optionalEvent

const startDate = moment().subtract(config.scraping.numDaysBack, 'days').startOf('day').toDate();

const nextAutomaticScrapeDate : Date | null = config.scraping.periodicScrapingIntervalHours ? moment().add(config.scraping.periodicScrapingIntervalHours, 'hours').toDate() : null;
const nextAutomaticScrapeDate: Date | null = config.scraping.periodicScrapingIntervalHours
? moment().add(config.scraping.periodicScrapingIntervalHours, 'hours').toDate()
: null;

await eventPublisher.emit(EventNames.IMPORT_PROCESS_START, new Events.ImportStartEvent(
`Starting to scrape from ${startDate} to today`,
nextAutomaticScrapeDate,
));
await eventPublisher.emit(
EventNames.IMPORT_PROCESS_START,
new Events.ImportStartEvent(`Starting to scrape from ${startDate} to today`, nextAutomaticScrapeDate),
);

const companyIdToTransactions = await scrapeFinancialAccountsAndFetchTransactions(
config.scraping,
Expand Down
1 change: 0 additions & 1 deletion packages/preload/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@
*/

export * from './eventsBridge';

16 changes: 8 additions & 8 deletions packages/renderer/src/components/Body.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,12 @@ const Body = () => {
closeModal();
};

const shouldShowNextRunTime = !!(configStore.nextAutomaticScrapeDate && Number(configStore.config.scraping.periodicScrapingIntervalHours));
const nextRunTimeString = configStore.nextAutomaticScrapeDate ? new Date(configStore.nextAutomaticScrapeDate).toLocaleTimeString() : null;
const shouldShowNextRunTime = !!(
configStore.nextAutomaticScrapeDate && Number(configStore.config.scraping.periodicScrapingIntervalHours)
);
const nextRunTimeString = configStore.nextAutomaticScrapeDate
? new Date(configStore.nextAutomaticScrapeDate).toLocaleTimeString()
: null;

return (
<Container className={styles.root}>
Expand Down Expand Up @@ -127,12 +131,8 @@ const Body = () => {
<Button variant="dark" size="lg" onClick={cleanAndScrape} disabled={configStore.isScraping}>
הפעל
</Button>
{shouldShowNextRunTime &&
<h6>
ריצה הבאה: {nextRunTimeString}
</h6>
}
<Image
{shouldShowNextRunTime && <h6>ריצה הבאה: {nextRunTimeString}</h6>}
<Image
src={settingsIcon}
onClick={() => showModal({} as Account, ModalStatus.GENERAL_SETTINGS)}
className={styles.pointer}
Expand Down

0 comments on commit 55b0148

Please sign in to comment.