Skip to content
This repository has been archived by the owner on Dec 2, 2023. It is now read-only.

Commit

Permalink
Latest fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
01CodeLT committed Nov 21, 2020
1 parent f22d6c5 commit a175804
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 31 deletions.
1 change: 0 additions & 1 deletion lib/ControlToolbar.js

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

11 changes: 1 addition & 10 deletions lib/DisplaySlide.js

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

2 changes: 1 addition & 1 deletion lib/DisplaySlide.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export function updateDisplayOptions(updatedOptions) {

export function getSlides(event) {
//Send slides to window
event.sender.send('slides-update', epub, slideshow);
event.sender.webContents.send('slides-update', epub, slideshow);
}

export function updateSlides(event, updatedEpub = null, updatedSlideshow = null) {
Expand Down
2 changes: 1 addition & 1 deletion main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { showToolbar, hideToolbar, toolbarWindow } from './lib/ControlToolbar';
import { displayWindow, toggleDisplay, controlDisplay, getSlides, updateSlides, updateDisplayOptions } from './lib/DisplaySlide';
import { uploadEpub, listEpubs, listEpubsFiltered, getEpub, getEpubPageRef, parseEpubPage, removeEpub } from './lib/EpubManager';

debug();
//debug();

//Setup nucleus analytics - anonymous
const Nucleus = require('nucleus-nodejs');
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "meeting-display",
"version": "2.0.1",
"version": "2.0.2",
"description": "Basic application for displaying books & magazines in epub format from the jw website in congregation meetings.",
"author": {
"name": "Luke Tinnion",
Expand Down
36 changes: 19 additions & 17 deletions src/app/display/display/display.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,23 @@ export class DisplayComponent implements OnInit {
ngOnInit() {}

ngAfterViewInit() {
//Listen for slides update
this.electronService.ipcRenderer.on('slides-update', (event, epub, slideshow) => {
console.log('update slides')
//Set epub, slides
this.epub = epub;

//Set slides and run change detection
this.slideshow.active = slideshow.active;
this.slideshow.slides = slideshow.slides;
console.log(slideshow.slides);

this.changeDetector.detectChanges();

//Recalculate text height
this.calcTextHeight();
});

//Listen for slide controls
this.electronService.ipcRenderer.on('slides-control', (event, action, ...args) => {
//Convert action to camelCase and run
Expand All @@ -41,6 +58,7 @@ export class DisplayComponent implements OnInit {

//Listen for slide display options
this.electronService.ipcRenderer.on('slides-options', (event, options) => {
console.log('update options');

//Calculate max line number and set height
this.settings.lineHeight = options.fontSize * 1.25;
Expand All @@ -63,7 +81,7 @@ export class DisplayComponent implements OnInit {
this.changeDetector.detectChanges();
if(this.settings.fontSize !== options.fontSize) {
this.slideshow.active = 0;
this.electronService.ipcRenderer.send('slides-update');
this.electronService.ipcRenderer.send('slides-get');
}

//Assign settings
Expand All @@ -72,22 +90,6 @@ export class DisplayComponent implements OnInit {
}, 500);
});
this.electronService.ipcRenderer.send('slides-options');

//Listen for slides update
this.electronService.ipcRenderer.on('slides-update', (event, epub, slideshow) => {
//Set epub, slides
this.epub = epub;

//Set slides and run change detection
this.slideshow.active = slideshow.active;
this.slideshow.slides = slideshow.slides;

this.changeDetector.detectChanges();

//Recalculate text height
this.calcTextHeight();
});
this.electronService.ipcRenderer.send('slides-get');
}

calcTextHeight() {
Expand Down

0 comments on commit a175804

Please sign in to comment.