fix: allow premium-dark/premium-emerald in template id whitelists
Two separate Set-based whitelists (OFFER_TEMPLATE_IDS in app-runtime.js and TEMPLATE_IDS in ux-fixes-v1764.js) validated any explicit template selection before persisting/rendering it, but neither had been updated when premium-dark/premium-emerald were added. The per-order "Оформление PDF" picker's click handler calls persistOfferTemplate(), which silently returned false when the id failed this check -- so clicking either premium card in an order's offer modal did nothing, no error, no toast. Verified end-to-end against a real order: both ids now persist and the picker shows the selected state correctly. Also bumped performance.js's internal RELEASE tag, since it gates the cache-busting query string used to dynamically load ux-fixes-v1764.js and eight other core modules -- otherwise this fix would hit the same stale-cache issue just fixed in index.html. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
parent
5ead4a7f0c
commit
7446a551f6
@ -1101,7 +1101,7 @@ window.SUN_LEGACY_CATALOG_V175=[{"id":"1","name":"Фуршетный бокс
|
||||
}
|
||||
|
||||
const OFFER_TEMPLATE_KEY='sunOfferTemplateV1';
|
||||
const OFFER_TEMPLATE_IDS=new Set(['cream-elegance','neon-menu','emerald-circles','midnight-checklist','gourmet-hero','diamond-gold','light','midnight-glass','editorial-grid','warm-sun','bento-cards','event-story','black-gold','personal-letter','event-ticket','solar-experience','midnight-compact','emerald-gold','neon-emerald']);
|
||||
const OFFER_TEMPLATE_IDS=new Set(['cream-elegance','neon-menu','emerald-circles','midnight-checklist','gourmet-hero','diamond-gold','premium-dark','premium-emerald','light','midnight-glass','editorial-grid','warm-sun','bento-cards','event-story','black-gold','personal-letter','event-ticket','solar-experience','midnight-compact','emerald-gold','neon-emerald']);
|
||||
function offerTemplateId(){
|
||||
try{
|
||||
const api=window.SunOfferTemplate?.get?.();
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
(()=>{
|
||||
'use strict';
|
||||
const VERSION='17.7.3';
|
||||
const RELEASE='20260912-v17-7-6-signature-auth';
|
||||
const RELEASE='20260916-v18-1-1-template-whitelist-fix';
|
||||
|
||||
const hasStoredSession=()=>{try{return Object.keys(localStorage).some(k=>/^sb-.*-auth-token$/i.test(k)&&String(localStorage.getItem(k)||'').length>20)}catch(_){return false}};
|
||||
function installAuthBoot(){
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
const RELEASE_DAY='2026-09-07';
|
||||
const AUTO_DELAY_MS=60*1000;
|
||||
const AUTO_POLL_MS=15000;
|
||||
const TEMPLATE_IDS=new Set(['cream-elegance','neon-menu','emerald-circles','midnight-checklist','gourmet-hero','diamond-gold','light','midnight-glass','editorial-grid','warm-sun','bento-cards','event-story','black-gold','personal-letter','event-ticket','solar-experience','midnight-compact','emerald-gold','neon-emerald']);
|
||||
const TEMPLATE_IDS=new Set(['cream-elegance','neon-menu','emerald-circles','midnight-checklist','gourmet-hero','diamond-gold','premium-dark','premium-emerald','light','midnight-glass','editorial-grid','warm-sun','bento-cards','event-story','black-gold','personal-letter','event-ticket','solar-experience','midnight-compact','emerald-gold','neon-emerald']);
|
||||
const $=id=>document.getElementById(id);
|
||||
const qa=(s,r=document)=>[...r.querySelectorAll(s)];
|
||||
const esc=v=>window.SunSafe?.escapeHTML?window.SunSafe.escapeHTML(String(v??'')):String(v??'').replace(/[&<>"']/g,c=>({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c]));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user