Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@ require('crash-reporter').start();
var Menu = require('menu');
var Tray = require('tray');
var BrowserWindow = require('browser-window');
var AutoLaunch = require('auto-launch')
, start = new AutoLaunch({
name: 'Gitify',
path: process.execPath.match(/.*?\.app/)[0]
});
var AutoLaunch = require('auto-launch');

var iconIdle = path.join(__dirname, 'images', 'tray-idleTemplate.png');
var iconActive = path.join(__dirname, 'images', 'tray-active.png');

var autoStart = new AutoLaunch({
name: 'Gitify',
path: process.execPath.match(/.*?\.app/)[0]
});

app.on('ready', function(){
var appIcon = new Tray(iconIdle);
initWindow();
Expand Down Expand Up @@ -100,11 +101,11 @@ app.on('ready', function(){
});

ipc.on('startup-enable', function() {
start.enable();
autoStart.enable();
});

ipc.on('startup-disable', function() {
start.disable();
autoStart.disable();
});

ipc.on('app-quit', function() {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
},
"homepage": "https://github.com/ekonstantinidis/gitify",
"dependencies": {
"auto-launch": "^0.1.18",
"auto-launch": "=0.1.18",
"bootstrap": "=3.3.4",
"browserify": "=10.2.1",
"font-awesome": "=4.3.0",
Expand All @@ -145,7 +145,7 @@
"grunt-contrib-copy": "=0.8.0",
"grunt-contrib-less": "=1.0.1",
"grunt-contrib-watch": "=0.6.1",
"jest-cli": "=0.4.12",
"jest-cli": "=0.4.17",
"jscs": "^1.13.1",
"jshint-stylish": "=1.0.2",
"jsxhint": "=0.15.0",
Expand Down
14 changes: 11 additions & 3 deletions src/js/__tests__/stores/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ describe('Tests for SettingsStore', function () {
return {
sendChannel: function () {
return;
},
send: function () {
return;
}
};
};
Expand All @@ -39,21 +42,26 @@ describe('Tests for SettingsStore', function () {
it('should get the settings', function () {

spyOn(SettingsStore, 'trigger');

expect(SettingsStore.getSettings().participating).toBe(false);

});

it('should set a setting', function () {

spyOn(SettingsStore, 'trigger');

SettingsStore.onSetSetting('participating', true);

expect(SettingsStore.getSettings().participating).toBe(true);

});

it('should set the setting: openAtStartup ', function () {

spyOn(SettingsStore, 'trigger');
SettingsStore.onSetSetting('openAtStartup', true);
expect(SettingsStore.getSettings().openAtStartup).toBe(true);

});

});

describe('Tests for SettingsStore', function () {
Expand Down
3 changes: 2 additions & 1 deletion src/js/stores/settings.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
var ipc = window.require('ipc');

var Reflux = require('reflux');
var Actions = require('../actions/actions');

Expand Down Expand Up @@ -51,7 +53,6 @@ var SettingsStore = Reflux.createStore({
},

handleStartup: function (value) {
var ipc = window.require('ipc');
var method = (value) ? 'startup-enable' : 'startup-disable';
ipc.send(method);
}
Expand Down