From 986cb0797b8663c71ee14140702901a133eb84b0 Mon Sep 17 00:00:00 2001 From: "Gabriel SAILLARD (GitSquared)" Date: Sun, 28 Apr 2019 14:17:53 +0200 Subject: [PATCH] :zap: Replace clipboardy with electron.clipboard --- src/_boot.js | 14 -------------- src/classes/terminal.class.js | 7 ++----- src/package.json | 1 - 3 files changed, 2 insertions(+), 20 deletions(-) diff --git a/src/_boot.js b/src/_boot.js index 7e75f47b..a1442484 100644 --- a/src/_boot.js +++ b/src/_boot.js @@ -34,7 +34,6 @@ const ipc = electron.ipcMain; const path = require("path"); const url = require("url"); const fs = require("fs"); -const clip = require("clipboardy"); const Terminal = require("./classes/terminal.class.js").Terminal; ipc.on("log", (e, type, content) => { @@ -201,19 +200,6 @@ app.on('ready', () => { signale.watch("Waiting for frontend connection..."); }; - // Clipboard backend access - ipc.on("clipboard", (e, arg) => { - switch(arg) { - case "read": - clip.read().then(text => { - e.sender.send("clipboard-reply", text); - }); - break; - default: - throw new Error("Illegal clipboard access request"); - } - }); - // Support for multithreaded systeminformation calls signale.pending("Starting multithreaded calls controller..."); require("./_multithread.js"); diff --git a/src/classes/terminal.class.js b/src/classes/terminal.class.js index 6e7b8bbb..5cbf0137 100644 --- a/src/classes/terminal.class.js +++ b/src/classes/terminal.class.js @@ -220,11 +220,8 @@ class Terminal { this.clipboard.didCopy = true; }, paste: () => { - this.Ipc.once("clipboard-reply", (e, txt) => { - this.write(txt); - this.clipboard.didCopy = false; - }); - this.Ipc.send("clipboard", "read"); + this.write(electron.remote.clipboard.readText()); + this.clipboard.didCopy = false; }, didCopy: false }; diff --git a/src/package.json b/src/package.json index f5600901..26b15c58 100644 --- a/src/package.json +++ b/src/package.json @@ -23,7 +23,6 @@ }, "homepage": "/~https://github.com/GitSquared/edex-ui#readme", "dependencies": { - "clipboardy": "2.0.0", "color": "3.1.1", "howler": "2.1.2", "nanoid": "2.0.1",