Skip to content
This repository was archived by the owner on Nov 10, 2020. It is now read-only.

Os fixes #202

Merged
merged 2 commits into from
Oct 8, 2017
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
33 changes: 16 additions & 17 deletions app/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ const handleRedirect = (e, link) => {
}
};


/** This function will create the tray icon */
function initTray() {
// No idea why using let or var or const with tray causes the tray not to display anything
Expand All @@ -81,23 +82,6 @@ function initTray() {
function createWindow() {
notify.init();

// Some shortcuts to make development easier.
if (process.env.NODE_ENV === 'development') {
const { globalShortcut } = electron;

const showNotifGlobal = globalShortcut.register('CommandOrControl+Alt+N', () => {
notify.show({
body: 'This is a test notification.',
content: { comment_id: 728393, created_time: 1500665102, rant_id: 538347, read: 0, type: 'comment_mention', uid: 719925 },
id: 538347,
});
});

if (!showNotifGlobal) {
console.warn('registration failed :(');
}
}

// Send usage data to firebase
if (process.env.NODE_ENV !== 'development') {
let plat = '';
Expand Down Expand Up @@ -178,6 +162,18 @@ function createWindow() {
initTray();
}

const shouldQuit = app.makeSingleInstance(() => {
// Someone tried to run a second instance, we should focus our window.
if (mainWindow) {
if (mainWindow.isMinimized()) mainWindow.restore();
mainWindow.focus();
}
});

if (shouldQuit) {
app.quit();
}

// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
Expand Down Expand Up @@ -221,6 +217,9 @@ ipcMain.on('auto-launch', (event, arg) => {

const AppAutoLauncher = new AutoLaunch({
name: 'devRantron',
mac: {
useLaunchAgent: true,
},
});

if (arg) {
Expand Down
12 changes: 7 additions & 5 deletions app/src/res/sass/modules/common.sass
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,17 @@ $post_comment_height: 13rem
margin: 0px 2px -3px 2px

.release_info_container
padding: 0.1rem
padding: 0 0.5rem 0 2rem
color: white
height: 100%
overflow-y: scroll
display: flex
justify-content: center
align-items: flex-start
.release_info
padding: 1.5rem
padding: 0 1.5rem 1rem 1.5rem
border-radius: 5px
background-color: #515270
max-width: 800px
margin-left: auto
margin-right: auto
img
width: 100%
border-radius: 6px
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "devrantron",
"version": "1.4.0",
"version": "1.4.1",
"main": "./build/app/app.js",
"description": "An open source cross platform desktop application for devRant",
"scripts": {
Expand Down