Skip to content
This repository has been archived by the owner on Mar 18, 2023. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
…-desktop into main
  • Loading branch information
filiptronicek committed Nov 23, 2020
2 parents 32d321d + a838229 commit 3f26300
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Interclip desktop client

Keyboard shortcuts:

* ```Ctrl(Command)+C``` = copy code
* ```Ctrl(Command)+C``` = copy code

(BETA) Download for Windows (click on image below or download from releases)

Expand Down
2 changes: 1 addition & 1 deletion assets/js/clip.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function sendURL(urlInput = document.getElementById("search-input").value) {

ipcRenderer.on("asynchronous-reply", (_event, code) => {
if (code != "") {
document.getElementById("code").innerText =
document.getElementById("code").innerHTML =
"code: <span id='theCode'>" + code + "</span>";
} else {
console.log("Code is not valid");
Expand Down
12 changes: 7 additions & 5 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ if (setupEvents.handleSquirrelEvent()) {
return;
}

const endpoint = "https://link.mannoviny.cz";

function createWindow() {
// Create the browser window.
win = new BrowserWindow({
Expand Down Expand Up @@ -62,7 +64,7 @@ function createWindow() {
{
label: "About",
click() {
shell.openExternal("http://uni.hys.cz/about");
shell.openExternal(`${endpoint}/about`);
},
},
{ type: "separator" },
Expand All @@ -80,9 +82,9 @@ function createWindow() {
// receive message from index.html
ipcMain.on("asynchronous-message", (event, url) => {
axios
.get(`http://uni.hys.cz/includes/api?url=${url}`)
.get(`${endpoint}/includes/api?url=${url}`)
.then((res) => {
const code = res.data;
const code = res.data.result;
// send message to index.html
event.sender.send("asynchronous-reply", code);
})
Expand All @@ -93,9 +95,9 @@ function createWindow() {
dialog.showErrorBox("Error with your code", `This code should be 5 characters long, not ${code.length}, please correct that.`);
} else {
axios
.get(`http://uni.hys.cz/includes/get-api?user=${code}`)
.get(`${endpoint}/includes/get-api?code=${code}`)
.then((res) => {
const url = res.data;
const url = res.data.result;
// send message to index.html
event.sender.send("url-reply", url);
})
Expand Down

0 comments on commit 3f26300

Please sign in to comment.