Skip to content

Commit

Permalink
Fixes to UI for auto updater
Browse files Browse the repository at this point in the history
  • Loading branch information
aaroncox committed Jun 7, 2020
1 parent adab573 commit bc60e01
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
13 changes: 8 additions & 5 deletions app/modules/main/containers/Root.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Provider } from 'react-redux';

import i18n from '../../../shared/i18n';
import ScrollToTop from '../../../shared/components/Global/ScrollToTop';
import UpdaterContainer from '../../../shared/containers/Root/Updater';

import MessageAppError from '../../../shared/components/Global/Message/App/Error';

Expand Down Expand Up @@ -35,11 +36,13 @@ export default class Root extends Component<Props> {
) : (
<Provider store={store}>
<I18nextProvider i18n={i18n}>
<ConnectedRouter history={this.props.history} store={this.props.store}>
<ScrollToTop>
<Routes />
</ScrollToTop>
</ConnectedRouter>
<UpdaterContainer>
<ConnectedRouter history={this.props.history} store={this.props.store}>
<ScrollToTop>
<Routes />
</ScrollToTop>
</ConnectedRouter>
</UpdaterContainer>
</I18nextProvider>
</Provider>
);
Expand Down
6 changes: 6 additions & 0 deletions app/modules/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ import { AppContainer } from 'react-hot-loader';
import { configureStore, history } from '../../shared/store/renderer/configureStore';
import Root from './containers/Root';
import Routes from './routes';
import { downloadProgress } from '../../shared/actions/app';

const { store } = configureStore();
const { ipcRenderer } = require('electron');

class Index extends Component<Props> {
render() {
Expand Down Expand Up @@ -42,3 +44,7 @@ if (module.hot) {
renderApp(newRoutes);
});
}

ipcRenderer.on('downloadProgress', (event, data) => {
store.dispatch(downloadProgress(data));
});
2 changes: 1 addition & 1 deletion app/shared/electron/ipc.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const configureIPC = (ui, primary = false) => {

ipcMain.on('anchor-resize', (event, size = defaultSize) => {
ui.setSize(size.width, size.height);
ui.webContents.setZoomFactor(size.zoom)
ui.webContents.setZoomFactor(size.zoom);
});
}
};
Expand Down
2 changes: 1 addition & 1 deletion app/shared/electron/updater.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ let updater;
autoUpdater.logger = log;
autoUpdater.logger.transports.file.level = "info";
autoUpdater.autoDownload = false;
autoUpdater.allowPrerelease = true;
autoUpdater.allowPrerelease = false;

autoUpdater.on('error', (error) => {
dialog.showErrorBox('Error: ', error == null ? 'unknown' : (error.stack || error).toString());
Expand Down

0 comments on commit bc60e01

Please sign in to comment.