fix 509: clear clipboard on exit

This commit is contained in:
antelle 2017-11-26 20:44:53 +01:00
parent 51cd1eea9a
commit 78fed18d75
2 changed files with 8 additions and 1 deletions

View File

@ -1,3 +1,4 @@
const Backbone = require('backbone');
const Launcher = require('./launcher');
const AppSettingsModel = require('../models/app-settings-model');
@ -9,10 +10,15 @@ const CopyPaste = {
Launcher.setClipboardText(text);
const clipboardSeconds = AppSettingsModel.instance.get('clipboardSeconds');
if (clipboardSeconds > 0) {
setTimeout(() => {
const clearClipboard = () => {
if (Launcher.getClipboardText() === text) {
Launcher.clearClipboardText();
}
};
Backbone.on('main-window-will-close', clearClipboard);
setTimeout(() => {
clearClipboard();
Backbone.off('main-window-will-close', clearClipboard);
}, clipboardSeconds * 1000);
}
return {success: true, seconds: clipboardSeconds};

View File

@ -10,6 +10,7 @@ Release notes
`-` fixed tray icon click crash
`*` show usernames in entry list
`*` password can be hidden as other fields
`*` clear clipboard on exit
##### v1.5.6 (2017-08-31)
`-` fix #722: hang on start in desktop