:raised_hands:fixed internal links issue

This commit is contained in:
akashnimare
2016-07-25 03:00:37 +05:30
parent 7a3f8bb10e
commit 776dd3b85f
2 changed files with 10 additions and 1 deletions

View File

@@ -18,7 +18,14 @@ let mainWindow;
// Load this url in main window
const targetUrl = 'file://' + path.join(__dirname, '../renderer', 'index.html');
let targetLink = data["domain"] || '';
// let targetLink = data["domain"] || '';
let targetLink = function () {
if (data["domain"] !== undefined) {
return data["domain"]
}
}
const APP_ICON = path.join(__dirname, '../resources', 'Icon');

View File

@@ -1,6 +1,7 @@
window.onload = function getURL() {
const request = require('request');
const JsonDB = require('node-json-db');
const ipcRenderer = require('electron').ipcRenderer;
const dialogs = require('dialogs')()
const db = new JsonDB("domain", true, true);
const data = db.getData("/");
@@ -17,6 +18,7 @@
request(checkURL, function (error, response, body) {
if (!error && response.statusCode !== 404) {
db.push("/domain", newurl);
ipcRenderer.send('new-domain', newurl);
window.location.href = newurl ;
}
else {