basic web page build restored
This commit is contained in:
@ -9,11 +9,17 @@ import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
|
||||
import {Header} from './header'
|
||||
import Footer from './footer'
|
||||
|
||||
const { ipcRenderer, remote } = require('electron');
|
||||
window.currentWindow = remote.getCurrentWindow()
|
||||
|
||||
//var io = require("socket.io-client");
|
||||
//window.torrentSocket = io(document.location.protocol + '//' + document.location.hostname + (process.env.NODE_ENV === 'production' ? '/' : ':8095/'));
|
||||
if(typeof WEB !== 'undefined')
|
||||
{
|
||||
const io = require("socket.io-client");
|
||||
window.torrentSocket = io(document.location.protocol + '//' + document.location.hostname + (process.env.NODE_ENV === 'production' ? '/' : ':8095/'));
|
||||
}
|
||||
else
|
||||
{
|
||||
const { ipcRenderer, remote } = require('electron');
|
||||
window.currentWindow = remote.getCurrentWindow()
|
||||
|
||||
window.torrentSocket = {}
|
||||
window.torrentSocket.callbacks = {}
|
||||
window.torrentSocket.listeners = {}
|
||||
@ -53,12 +59,13 @@ window.currentWindow = remote.getCurrentWindow()
|
||||
delete window.torrentSocket.callbacks[id]
|
||||
});
|
||||
|
||||
|
||||
ipcRenderer.on('url', (event, url) => {
|
||||
console.log('url', url)
|
||||
router(url)
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Needed for onTouchTap
|
||||
// http://stackoverflow.com/a/34015469/988941
|
||||
@ -132,7 +139,7 @@ class App extends Component {
|
||||
<MuiThemeProvider>
|
||||
<div>
|
||||
{
|
||||
!window.currentWindow.isModal()
|
||||
window.currentWindow && !window.currentWindow.isModal()
|
||||
&&
|
||||
<Header />
|
||||
}
|
||||
|
@ -7,8 +7,6 @@ import TextField from 'material-ui/TextField'
|
||||
import Slider from 'material-ui/Slider'
|
||||
|
||||
import fs from 'fs'
|
||||
const {dialog} = require('electron').remote
|
||||
|
||||
export default class ConfigPage extends Page {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
|
@ -7,7 +7,6 @@ import TextField from 'material-ui/TextField'
|
||||
import Slider from 'material-ui/Slider'
|
||||
|
||||
import fs from 'fs'
|
||||
const {dialog} = require('electron').remote
|
||||
|
||||
export default class ConfigPage extends Page {
|
||||
constructor(props) {
|
||||
|
Reference in New Issue
Block a user