Skip to content
This repository has been archived by the owner on Oct 22, 2021. It is now read-only.

Commit

Permalink
⚡ Replace clipboardy with electron.clipboard
Browse files Browse the repository at this point in the history
  • Loading branch information
GitSquared committed Apr 28, 2019
1 parent 65d10c7 commit 986cb07
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 20 deletions.
14 changes: 0 additions & 14 deletions src/_boot.js
Expand Up @@ -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) => {
Expand Down Expand Up @@ -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");
Expand Down
7 changes: 2 additions & 5 deletions src/classes/terminal.class.js
Expand Up @@ -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
};
Expand Down
1 change: 0 additions & 1 deletion src/package.json
Expand Up @@ -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",
Expand Down

0 comments on commit 986cb07

Please sign in to comment.