Skip to content

Commit

Permalink
3.9.3
Browse files Browse the repository at this point in the history
  • Loading branch information
MayGo committed Feb 11, 2020
1 parent cc1fb0c commit 2343d6f
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 10 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,16 @@ Tockler is migrating from Aurelia to React. So some things may not work right no
![Summary](https://github.com/MayGo/tockler/raw/master/screenshots/tockler-summary.png 'Summary')
![Tray window](https://github.com/MayGo/tockler/raw/master/screenshots/tockler-tray.png 'Tray window')

# Debugging

## Logs

By default, tockler writes logs to the following locations:

on Linux: ~/.config/tockler/logs/main.log
on macOS: ~/Library/Logs/tockler/main.log
on Windows: %USERPROFILE%\AppData\Roaming\tockler\logs\main.log

# Donations

This project needs you! If you would like to support this project's further development, feel free to donate.
Expand Down
2 changes: 1 addition & 1 deletion electron/app/services/app-setting-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export class AppSettingService {
const appSetting: AppSetting = await AppSetting.create(appSettingAttributes);

const { name } = appSettingAttributes;
this.cache[name] = appSettingAttributes;
this.cache[name] = appSetting;
this.logger.info(`Created appSetting with title ${appSettingAttributes.name}.`);
return appSetting;
}
Expand Down
10 changes: 9 additions & 1 deletion electron/app/services/settings-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@ export class SettingsService {
where: {
name: name,
},
defaults: {
name,
},
});

this.logger.debug(`Setting ${name} to cache:`, item.toJSON());
this.logger.debug(`Setting ${name} to cache:`, item && item.toJSON());
this.cache[name] = item;

return item;
Expand Down Expand Up @@ -82,6 +85,11 @@ export class SettingsService {

if (settingsItem.jsonData.id) {
let logItem = await TrackItem.findByPk(settingsItem.jsonData.id);
if (!logItem) {
this.logger.error(`No Track item found by pk: ${settingsItem.jsonData.id}`);
return null;
}

return logItem.toJSON();
}

Expand Down
13 changes: 6 additions & 7 deletions electron/app/state-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export class StateManager {
const item: TrackItem = await this.createNewRunningTrackItem(rawItem);
logger.info('log-item-started', item.toJSON());
await this.setLogTrackItemMarkedAsRunning(item);
// event.sender.send('log-item-started', item.toJSON());

sendToTrayWindow('log-item-started', JSON.stringify(item.toJSON()));
}

Expand All @@ -67,15 +67,14 @@ export class StateManager {
if (logItem) {
this.logTrackItemMarkedAsRunning = logItem;
this.setCurrentTrackItem(logItem);
} else {
logger.info('No runnin log item');
}

if (this.logTrackItemMarkedAsRunning) {
logger.info('Restored running LogTrackItem:', logItem.toJSON());
}

return logItem;
return logItem;
} else {
logger.info('No runnin log item');
}
return null;
}

getLogTrackItemMarkedAsRunning() {
Expand Down
2 changes: 1 addition & 1 deletion electron/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tockler",
"version": "3.9.2",
"version": "3.9.3",
"description": "Automatically track applications usage and working time",
"author": "Maigo Erit <[email protected]>",
"license": "GPL-2.0",
Expand Down

0 comments on commit 2343d6f

Please sign in to comment.