Skip to content

Commit

Permalink
Support JSON.stringify of objects (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
yogat3ch committed Dec 21, 2023
1 parent 1ffd20d commit 8dec8b4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions inst/js/cookie_input.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ function getCookies(){

Shiny.addCustomMessageHandler('cookie-set', function(msg){
try {
if (typeof msg.value == "object") {
msg.value = JSON.stringify(msg.value)
}
Cookies.set(msg.name, msg.value, msg.attributes);
let cookie = Cookies.get(msg.name);
if (cookie === undefined) {
Expand Down

0 comments on commit 8dec8b4

Please sign in to comment.