Skip to content

Commit

Permalink
remove default config from renderer
Browse files Browse the repository at this point in the history
  • Loading branch information
baruchiro committed Oct 14, 2024
1 parent 952e098 commit 967e1ec
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 41 deletions.
2 changes: 1 addition & 1 deletion packages/main/src/backend/configManager/defaultConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import { type Config } from '../commonTypes';

const DEFAULT_CONFIG: Config = {
scraping: {
timeout: 60000,
numDaysBack: 40,
showBrowser: false,
accountsToScrape: [],
timeout: 60000,
},
outputVendors: {
csv: {
Expand Down
42 changes: 2 additions & 40 deletions packages/renderer/src/store/ConfigStore.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,51 +62,13 @@ 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));
};

const DEFAULT_CONFIG: Config = {
scraping: {
timeout: 60000,
numDaysBack: 40,
showBrowser: false,
accountsToScrape: [],
},
outputVendors: {
csv: {
active: true,
options: {
filePath: 'transaction.csv',
},
},
json: {
active: false,
options: {
filePath: 'transaction.json',
},
},
ynab: {
active: false,
options: {
accessToken: 'YNAB_ACCESS_TOKEN_GOES_HERE',
budgetId: '',
accountNumbersToYnabAccountIds: {},
},
},
googleSheets: {
active: false,
options: {
credentials: {},
spreadsheetId: '',
},
},
},
};

export class ConfigStore {
config: Config;

Expand All @@ -118,7 +80,7 @@ export class ConfigStore {
AccountScrapingData
>;
constructor() {
this.config = DEFAULT_CONFIG;
this.config = {} as Config;
this.accountScrapingData = new Map();
makeAutoObservable(this);

Expand Down

0 comments on commit 967e1ec

Please sign in to comment.