Versatile Banner

Hi, I noticed that changing the cookie name doesn’t cause the banner to re-appear as per the help text. I have tweaked code in versatile-banner.gjs around line 25/26 which resolves it and causes the banner to reappear if the cookie name is changed. Not sure if this is the best way. (Sorry I don’t have the github setup to create fork/pull)

Thanks

  cookieClosed = cookie("banner_closed");
  cookieClosed = (this.cookieClosed && JSON.parse(this.cookieClosed).name == settings.cookie_name)
    ? this.cookieClosed
    : null;
  cookieCollapsed = cookie("banner_collapsed");
  cookieCollapsed = (this.cookieCollapsed && JSON.parse(this.cookieCollapsed).name == settings.cookie_name)
    ? this.cookieCollapsed
    : null;
2 Likes