Skip to content

Commit

Permalink
feat: on app updater
Browse files Browse the repository at this point in the history
  • Loading branch information
geolffreym committed Apr 24, 2021
1 parent ccf280e commit 0afd88b
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 12 deletions.
4 changes: 3 additions & 1 deletion src/render/core/app/components/app-drag-bar/index.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import Logo from 'components/util-header-logo'
import AppUpdater from 'components/util-updater'

const electron = window.require('electron');
const ipcRenderer = electron.ipcRenderer;
Expand Down Expand Up @@ -35,7 +36,8 @@ export default class DragBar extends React.PureComponent {
<section className="full-width full-height absolute">
<header id="drag-bar"
className={`relative transparent z-depth-100 z-index-1000`}>
<Logo />
<Logo/>
<AppUpdater/>

<ul className="list-unlisted relative d-flex align-items-center">
<li onClick={(e) => this.minimizeWin(e)} className="margin-right-4 d-flex align-items-center">
Expand Down
File renamed without changes.
12 changes: 2 additions & 10 deletions ...p/components/app-movies-updater/index.jsx → ...ore/app/components/util-updater/index.jsx
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,18 @@ const webFrame = electron.webFrame;
export default class AppMainUpdater extends React.PureComponent {
constructor(props) {
super(props);
this.nRef = null;
this.mRef = null;
}

componentDidMount() {
// Clear old cache on render
// Restart listeners
// Check for updates
webFrame.clearCache();
log.info('Requesting update');
ipcRenderer.removeAllListeners('update_available');
ipcRenderer.send('check_update'); // Check for update
ipcRenderer.on('update_available', () => {
this.mRef.innerText = 'A new update is available. The app it is being updated and will restart on completion...';
this.nRef.classList.remove('hidden');
this.mRef.classList.remove('hidden');
});

}
Expand All @@ -32,13 +29,8 @@ export default class AppMainUpdater extends React.PureComponent {
this.mRef = r
}

getNRef = (r) => {
this.nRef = r
}

render() {
return <div id="notification" ref={this.getNRef} className="hidden">
<p ref={this.getMRef}>Checking updates..</p>
</div>
return <strong ref={this.getMRef} className={'white-text hidden bold'} />
}
}
File renamed without changes.
1 change: 0 additions & 1 deletion src/render/core/app/pages/index-view/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import AppMovieDetails from 'layout/app-movie-details/'
import AppNav from 'components/app-movies-nav-bar/'
import AppSearch from 'components/app-movies-search/'
import AppLoader from 'components/app-movie-player-loader'
// import AppUpdater from 'components/app-movies-updater'
import StatsValue from "components/util-stats";
import BoxLoader from 'components/util-box-loader'
import Movie from 'resource/movies'
Expand Down

0 comments on commit 0afd88b

Please sign in to comment.