Skip to content

Commit

Permalink
Fix: blank screen after 2.0.5 (#604)
Browse files Browse the repository at this point in the history
This fixes the issue in 2.0.5 when loading the app there is a blank
screen (no importers and exporters)

Added a default config to ConfigStore constructor

---------

Co-authored-by: Baruch Odem <[email protected]>
  • Loading branch information
shaiu and baruchiro authored Oct 14, 2024
1 parent 782f834 commit 3f036a6
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions packages/renderer/src/store/ConfigStore.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ import { autorun, makeAutoObservable, toJS } from 'mobx';
import { createContext, useContext } from 'react';
import accountMetadata, { exporterUIHandlers } from '../accountMetadata';
import {
AccountStatus,
AccountType,
ExporterResultType,
type Account,
AccountStatus,
type AccountToScrapeConfig,
AccountType,
type BudgetTrackingEvent,
type CompanyTypes,
type Config,
type DownloadChromeEvent,
type Exporter,
ExporterResultType,
type Importer,
type Log,
type OutputVendorName,
type DownloadChromeEvent,
} from '../types';

interface AccountScrapingData {
Expand Down Expand Up @@ -60,22 +60,22 @@ const createAccountObject = (
};

const saveConfigIntoFile = (config?: Config) => {
if (!config) {
if (!config || Object.keys(config).length === 0) {
console.warn(`Can't save config into file. Config is ${config}`);
return;
}
updateConfig(toJS(config));
};

export class ConfigStore {
config: Config = {} as Config;
config: Config;

chromeDownloadPercent = 0;

// TODO: move this to a separate store
accountScrapingData: Map<CompanyTypes | OutputVendorName, AccountScrapingData>;

constructor() {
this.config = {} as Config;
this.accountScrapingData = new Map();
makeAutoObservable(this);

Expand Down

0 comments on commit 3f036a6

Please sign in to comment.