Open JeffersonBledsoe opened 1 year ago
I guess that would require some type of cookie watcher, like https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/cookies/onChanged ?
I guess that would require some type of cookie watcher, like https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/cookies/onChanged ?
Yep. We would probably use useCookies(['statusmessage'])
from react-cookie or something similar to handle this as Safari support isn't there and I'm not sure on the state of polyfills for the API. The Cookies Store
API looks like a similar situation.
Is your feature request related to a problem? Please describe. Some Plone responses set a
statusmessage
cookie. This cookie is the 'raw' value as base64 to be used by products.statusmessage which does a little bit of parsing to split apart the message and status type. It would be nice to encapsulate the logic that is normally done in classic in Volto too and provide the status messages in an easier to use format for any potential Volto users.Describe the solution you'd like
statusmessage
cookie changes. The reducer performs the same message/ type splitting done by products.statusmessage and presents the message/ type in a format more useable in JS.Describe alternatives you've considered
Additional context Whilst plone.restapi doesn't currently use status messages (see plone/plone.restapi#584), some addons still provide useful information via IStatusMessage.