Skip to content

Commit

Permalink
3.14.2
Browse files Browse the repository at this point in the history
don't notify if exact log item is running.
  • Loading branch information
Maigo Erit committed May 26, 2020
1 parent 2fa85b2 commit b9a5691
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 16 deletions.
2 changes: 1 addition & 1 deletion electron/app/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ let root = path.join(__dirname, '..');
let client = isDevelopment ? path.join(root, '..', 'client', 'build') : path.join(root, 'dist');
// Load real data even when in development

let useRealDataInDev = true;
let useRealDataInDev = false;
let userDir =
isDevelopment && useRealDataInDev
? `/Users/${OS.userInfo().username}/Library/Application Support/Tockler`
Expand Down
36 changes: 22 additions & 14 deletions electron/app/task-analyser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { settingsService } from './services/settings-service';
import { TrackItemType } from './enums/track-item-type';
import { showNotification } from './notification';
import * as randomcolor from 'randomcolor';
import { stateManager } from './state-manager';
export interface TrackItemRaw {
app?: string;
taskName?: TrackItemType;
Expand Down Expand Up @@ -69,20 +70,27 @@ export class TaskAnalyser {
let title = this.findFirst(item.title, patObj.takeTitle) || item.title;
let app = this.findFirst(item.title, patObj.takeGroup) || foundStr;

this.newItem = {
app: app,
title: title,
taskName: TrackItemType.LogTrackItem,
beginDate: new Date(),
endDate: new Date(),
color: randomcolor(),
};
showNotification({
body: `Click to create: "${app} - ${title}"`,
title: 'Create new task?',
onClick: this.onNotificationClick,
silent: true,
});
const runningItem = stateManager.getLogTrackItemMarkedAsRunning();

const sameItem =
runningItem && runningItem.app == app && runningItem.title === title;

if (!sameItem) {
this.newItem = {
app: app,
title: title,
taskName: TrackItemType.LogTrackItem,
beginDate: new Date(),
endDate: new Date(),
color: randomcolor(),
};
showNotification({
body: `Click to create: "${app} - ${title}"`,
title: 'Create new task?',
onClick: this.onNotificationClick,
silent: true,
});
}
}
} catch (e) {
logger.error('analyseAndNotify:', e);
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.14.1",
"version": "3.14.2",
"description": "Automatically track applications usage and working time",
"author": "Maigo Erit <[email protected]>",
"license": "GPL-2.0",
Expand Down

0 comments on commit b9a5691

Please sign in to comment.