Skip to content

Commit

Permalink
Updated .gitignore to ignore release and dist folders. Added logging.
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphaël Godart committed Nov 7, 2018
1 parent 18ee093 commit ee2eae5
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 24 deletions.
4 changes: 3 additions & 1 deletion .gitignore
@@ -1,2 +1,4 @@
.vscode/
node_modules/
node_modules/
dist/
release/
14 changes: 5 additions & 9 deletions main.js

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

2 changes: 1 addition & 1 deletion main.js.map

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

14 changes: 5 additions & 9 deletions main.ts
@@ -1,7 +1,6 @@
import { app, BrowserWindow, screen } from 'electron';
import * as path from 'path';
import * as url from 'url';
import { Constants } from './src/app/core/constants';

// Logging needs to be imported in main.ts also. Otherwise it just doesn't work anywhere else.
// See post by megahertz: https://github.com/megahertz/electron-log/issues/60
Expand Down Expand Up @@ -54,12 +53,9 @@ function createWindow() {
win = null;
});

// 'ready-to-show' doesn't fire on Windows. See: https://github.com/electron/electron/issues/7779
// win.on('ready-to-show', function () {
// win.show();
// win.focus();
// });
win.webContents.on('dom-ready', function () {
// 'ready-to-show' doesn't fire on Windows in dev mode. In prod it seems to work.
// See: https://github.com/electron/electron/issues/7779
win.on('ready-to-show', function () {
win.show();
win.focus();
});
Expand All @@ -75,7 +71,7 @@ function createWindow() {
}

try {
log.info(`+++ Starting ${Constants.applicationName} (${Constants.applicationVersion}) +++`);
log.info(`+++ Starting +++`);

// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
Expand All @@ -84,7 +80,7 @@ try {

// Quit when all windows are closed.
app.on('window-all-closed', () => {
log.info(`+++ Stopping ${Constants.applicationName} (${Constants.applicationVersion}) +++`);
log.info(`+++ Stopping +++`);
// On OS X it is common for applications and their menu bar
// to stay active until the user quits explicitly with Cmd + Q
if (process.platform !== 'darwin') {
Expand Down
3 changes: 3 additions & 0 deletions src/app/components/main/main.component.ts
@@ -1,6 +1,8 @@
import { Component, OnInit } from '@angular/core';
import { CollectionService } from '../../services/collection.service';
import { Subscription } from "rxjs";
import log from 'electron-log';
import { Constants } from '../../core/constants';

@Component({
selector: 'main-page',
Expand All @@ -13,6 +15,7 @@ export class MainComponent implements OnInit {
constructor(private collectionService: CollectionService) {
this.subscription = collectionService.storageDirectoryInitialized$.subscribe((hasCollections) => this.hasCollections = hasCollections);
this.hasCollections = collectionService.hasCollections;
log.info(`+++ Showing ${Constants.applicationName} (${Constants.applicationVersion}) main page +++`);
}

public hasCollections: boolean;
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/notes/notes.component.ts
Expand Up @@ -10,7 +10,7 @@ import log from 'electron-log';
})
export class NotesComponent implements OnInit {
constructor(private collectionService: CollectionService) {
log.info("Showing main screen");
log.info("Showing notes page");
}

public allNotesCount: number = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/welcome/welcome.component.ts
Expand Up @@ -16,7 +16,7 @@ import { OperationResult } from '../../services/operationResult';
export class WelcomeComponent implements OnInit {

constructor(private translate: TranslateService, private collectionService: CollectionService, private dialog: MatDialog, private zone: NgZone) {
log.info("Showing welcome screen");
log.info("Showing welcome page");
}

public applicationName: string = Constants.applicationName.toUpperCase();
Expand Down
4 changes: 2 additions & 2 deletions src/app/core/constants.ts
@@ -1,6 +1,6 @@
export class Constants {
static readonly applicationName: string = "Knowte";
static readonly applicationVersion: any = require("../../../package.json").version;
static readonly applicationName: string = require("../../../package.json").name;
static readonly applicationVersion: string = require("../../../package.json").version;
static readonly applicationCopyright: string = "Copyright Digimezzo Ⓒ 2013 - 2018";
static readonly donateUrl = "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=MQALEWTEZ7HX8";
static readonly websiteUrl = "https://www.digimezzo.com";
Expand Down

0 comments on commit ee2eae5

Please sign in to comment.