Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue626: Users password is now cleared from the clipboard after a short duration #762

Open
wants to merge 2 commits into
base: master
from

Conversation

2 participants
@jadach1
Copy link

commented Apr 12, 2019

Before:
Password was being cleared for clipboard when user would enter ctrl-c, but not when the user pressed the button right of the password.

Now:
Password is cleared from the clipboard for both scenarios.

@sallar
Copy link
Member

left a comment

Thank you! Just one small change needed


const __cache = {
timer: null
};

const currentWindow = remote.getCurrentWindow();

export function copyToClipboard(text) {
clipboard.writeText(text);

This comment has been minimized.

Copy link
@sallar

sallar Apr 13, 2019

Member

You need to clear the cache here. Similar to what happens in the other file?

This comment has been minimized.

Copy link
@jadach1

jadach1 Apr 14, 2019

Author

Hey, thank you for the reply!
I copied the function from shortcut.js to utils.js exactly, so I am not quite sure as to what you are referring to in regards to clearing the cache similar to the other file? Thanks !

This comment has been minimized.

Copy link
@sallar

sallar Apr 14, 2019

Member

Hi! If you check shortcut.js there is a few more lines in the beginning of the function which you need to copy as well

This comment has been minimized.

Copy link
@jadach1

jadach1 Apr 14, 2019

Author

Thanks, I will take a look.

This comment has been minimized.

Copy link
@jadach1

jadach1 Apr 18, 2019

Author

So I added in a bit more in addition to clearing the cache. Basically what I overlooked before was that the method is being called by every "copy-button" not just the password and this caused the clipboard to be cleared after 15 seconds regardless of whether it was a password or not.

This new change basically ensures that only the password will be cleared from the clipboard after 15 seconds.

I hope this helps

Let me know your thoughts on the matter , thanks !

@sallar sallar added this to the next-release milestone Apr 13, 2019

added a clear clipboard function for only passwords, all other fields…
… that are copied to the clipboard will remain whereby a password will be cleared after 15 s.
@sallar

sallar approved these changes Apr 20, 2019

@sallar

This comment has been minimized.

Copy link
Member

commented Apr 20, 2019

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.