Skip to content

Commit

Permalink
Fix thamara#152: adding copy button to about
Browse files Browse the repository at this point in the history
  • Loading branch information
araujoarthur0 committed May 16, 2020
1 parent 8f72eb8 commit 282c43e
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*eslint-disable no-useless-escape*/
const { app, BrowserWindow, dialog, ipcMain, Menu, net, shell, Tray } = require('electron');
const { app, BrowserWindow, clipboard, dialog, ipcMain, Menu, net, shell, Tray } = require('electron');
const path = require('path');
const Store = require('electron-store');
const isOnline = require('is-online');
Expand Down Expand Up @@ -375,8 +375,15 @@ function createWindow() {
message: 'Time to Leave',
type: 'info',
icon: iconpath,
detail: `\n${detail}`
});
detail: `\n${detail}`,
buttons: ['Copy', 'OK'],
noLink: true
}).then((result) => {
const buttonId = result.response;
if (buttonId === 0) {
clipboard.writeText(detail);
}
});
}
}
]
Expand Down

0 comments on commit 282c43e

Please sign in to comment.