Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix up key image export + Linting #14

Merged
merged 1 commit into from Mar 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
56 changes: 28 additions & 28 deletions src-electron/main-process/menu.js
Expand Up @@ -2,32 +2,32 @@ let template = [
{
label: "Edit",
submenu: [
{role: "undo"},
{role: "redo"},
{type: "separator"},
{role: "cut"},
{role: "copy"},
{role: "paste"},
{role: "pasteandmatchstyle"},
{role: "delete"},
{role: "selectall"}
{ role: "undo" },
{ role: "redo" },
{ type: "separator" },
{ role: "cut" },
{ role: "copy" },
{ role: "paste" },
{ role: "pasteandmatchstyle" },
{ role: "delete" },
{ role: "selectall" }
]
},
{
label: "View",
submenu: [
{role: "resetzoom"},
{role: "zoomin"},
{role: "zoomout"},
{type: "separator"},
{role: "togglefullscreen"}
{ role: "resetzoom" },
{ role: "zoomin" },
{ role: "zoomout" },
{ type: "separator" },
{ role: "togglefullscreen" }
]
},
{
role: "window",
submenu: [
{role: "minimize"},
{role: "close"}
{ role: "minimize" },
{ role: "close" }
]
},
{
Expand All @@ -45,23 +45,23 @@ if (process.platform === "darwin") {
template.unshift({
label: "Loki Wallet Atom",
submenu: [
{role: "about"},
{type: "separator"},
{role: "hide"},
{role: "hideothers"},
{role: "unhide"},
{type: "separator"},
{role: "quit"}
{ role: "about" },
{ type: "separator" },
{ role: "hide" },
{ role: "hideothers" },
{ role: "unhide" },
{ type: "separator" },
{ role: "quit" }
]
})

// Window menu
template[3].submenu = [
{role: "close"},
{role: "minimize"},
{role: "zoom"},
{type: "separator"},
{role: "front"}
{ role: "close" },
{ role: "minimize" },
{ role: "zoom" },
{ type: "separator" },
{ role: "front" }
]
}

Expand Down
8 changes: 4 additions & 4 deletions src-electron/main-process/modules/backend.js
Expand Up @@ -249,14 +249,14 @@ export class Backend {
case "save_png":
let filename = dialog.showSaveDialog(this.mainWindow, {
title: "Save " + params.type,
filters: [{name: "PNG", extensions: ["png"]}],
filters: [{ name: "PNG", extensions: ["png"] }],
defaultPath: os.homedir()
})
if (filename) {
let base64Data = params.img.replace(/^data:image\/png;base64,/, "")
let binaryData = new Buffer(base64Data, "base64").toString("binary")
fs.writeFile(filename, binaryData, "binary", (err) => {
if (err) { this.send("show_notification", {type: "negative", message: "Error saving " + params.type, timeout: 2000}) } else { this.send("show_notification", {message: params.type + " saved to " + filename, timeout: 2000}) }
if (err) { this.send("show_notification", { type: "negative", message: "Error saving " + params.type, timeout: 2000 }) } else { this.send("show_notification", { message: params.type + " saved to " + filename, timeout: 2000 }) }
})
}
break
Expand Down Expand Up @@ -475,9 +475,9 @@ export class Backend {
// eslint-disable-next-line
}).catch(error => {
if (this.config_data.daemons[net_type].type == "remote") {
this.send("show_notification", {type: "negative", message: "Remote daemon cannot be reached", timeout: 2000})
this.send("show_notification", { type: "negative", message: "Remote daemon cannot be reached", timeout: 2000 })
} else {
this.send("show_notification", {type: "negative", message: "Local daemon internal error", timeout: 2000})
this.send("show_notification", { type: "negative", message: "Local daemon internal error", timeout: 2000 })
}
this.send("set_app_data", {
status: {
Expand Down
10 changes: 5 additions & 5 deletions src-electron/main-process/modules/daemon.js
Expand Up @@ -14,7 +14,7 @@ export class Daemon {
this.net_type = "mainnet"
this.local = false // do we have a local daemon ?

this.agent = new http.Agent({keepAlive: true, maxSockets: 1})
this.agent = new http.Agent({ keepAlive: true, maxSockets: 1 })
this.queue = new queue(1, Infinity)
}

Expand All @@ -32,7 +32,7 @@ export class Daemon {
let lokid_path = path.join(__ryo_bin, "lokid")
let lokid_version_cmd = `"${lokid_path}" --version`
if (!fs.existsSync(lokid_path)) { resolve(false) }
child_process.exec(lokid_version_cmd, {detached: true}, (error, stdout, stderr) => {
child_process.exec(lokid_version_cmd, { detached: true }, (error, stdout, stderr) => {
if (error) { resolve(false) }
resolve(stdout)
})
Expand Down Expand Up @@ -187,12 +187,12 @@ export class Daemon {

this.sendRPC("set_bans", params).then((data) => {
if (data.hasOwnProperty("error") || !data.hasOwnProperty("result")) {
this.sendGateway("show_notification", {type: "negative", message: "Error banning peer", timeout: 2000})
this.sendGateway("show_notification", { type: "negative", message: "Error banning peer", timeout: 2000 })
return
}

let end_time = new Date(Date.now() + seconds * 1000).toLocaleString()
this.sendGateway("show_notification", {message: "Banned " + host + " until " + end_time, timeout: 2000})
this.sendGateway("show_notification", { message: "Banned " + host + " until " + end_time, timeout: 2000 })

// Send updated peer and ban list
this.heartbeatSlowAction()
Expand Down Expand Up @@ -220,7 +220,7 @@ export class Daemon {
return resolve(pivot[0])
}

this.getRPC("block_header_by_height", {height: estimated_height}).then((data) => {
this.getRPC("block_header_by_height", { height: estimated_height }).then((data) => {
if (data.hasOwnProperty("error") || !data.hasOwnProperty("result")) {
if (data.error.code == -2) { // Too big height
this.getRPC("last_block_header").then((data) => {
Expand Down