-
Notifications
You must be signed in to change notification settings - Fork 15
Copied content and paste button stick around too long #51
Comments
@dnwhte Thanks for the feedback! Are you thinking sessionStorage instead of localStorage? With clearing the copied item after the first time, I'd considered how operating systems handle it, generally when you copy to the clipboard, it can be pasted multiple times. |
I recall why we used localStorage over sessionStorage, it was so we could copy/paste between browser-tabs. sessionStorage is restricted to the specific browser-tab. |
I like localStorage, but just need some trigger to clear it on. Are there Umbraco login/logout events on the client side? Another issue with the way it currently is, an editor could paste content from a node they do not have access if they are using the same machine as the editor that had copied it. |
nvm, replying on umbraco events is not reliable. What about just expiring it in an hour? Add a timestamp in the localStorage and use it to check if time has passed. |
I'm swaying towards using |
|
v7 uses an old version of angular-local-storage which does not allow you to dynamically set the storage type. So we'd have to use the OOTB sessionStorage browser API. Might make the code a bit more brittle or verbose. Is that fine? I can proceed with a PR. FYI, v8 uses the latest version of angular-local-storage. |
I added a PR using sessionStorage (#52). It contains a get a set method for working with sessionStorage. The downside is it won't fallback to cookies like localStorageService. |
When a stacked content item is copied it gets added to Local Storage, but is never removed. Since local storage does not expire this leads to a confusing UX. An editor may come back to editing a page days or weeks after copying a stacked content and still see the paste button, which leads to confusion.
I would propose either:
Clear the copied item after it is pasted for the first time. If the user wanted more than one copy they would need to recopy.
Only keep the copied item around for the current Umbraco session.
A clear copied button. Could be more confusing since it doesn't mimic any other copy/paste experience.
Any thoughts? I'd be happy to do a PR.
The text was updated successfully, but these errors were encountered: