Skip to content

Commit

Permalink
Merge pull request #14 from Mikunj/key-image-minor-fix
Browse files Browse the repository at this point in the history
Fix up key image export + Linting
  • Loading branch information
Mikunj committed Mar 27, 2019
2 parents 0bacdd1 + 2aa713f commit cf2bb63
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 83 deletions.
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

0 comments on commit cf2bb63

Please sign in to comment.