mirror of https://github.com/keeweb/keeweb.git
fix 509: clear clipboard on exit
This commit is contained in:
parent
51cd1eea9a
commit
78fed18d75
|
@ -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};
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue