Files
tehran_taj/apps/user-app/dist/assets/CollectionView-zAs8aYXi.js
T
mahmoodandClaude Sonnet 5.5 0b973f9e46 fix(app): re-check the sales-expert flag on every dashboard visit
The "سفارش مشتریان" / "مشتریان من" entries are shown from session.isSalesExpert,
which was fetched from /expert/whoami only once, at sign-in. A slow or failed
request (silently swallowed) left the flag false until the next login, so an
expert saw a customer-only menu. The dashboard now asks again on mount and on
every re-activation, and keeps the current value when the request fails.

Rebuilds user-app and user-app-v2 dist.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-26 10:23:08 +03:30

2 lines
1.9 KiB
JavaScript

import{d as B,Y as b,a as M,o as V,c as n,q as t,C as f,P as g,i,b as o,m as s,F as q,r as N,g as v,I as S,e as E,h as F,E as H,$ as L,H as O,_ as $}from"./index-CW3p0GOu.js";import{P as z}from"./PageBar-DMRK3EvR.js";import{S as A}from"./SectionHead-BqQT521D.js";import{P as R}from"./ProductCard-C25sOeqt.js";import{u as T}from"./usePagedProducts-B-5bSdk2.js";const U={class:"coll"},Y={key:0,class:"coll__grid"},j={key:2,class:"coll__empty"},D=B({__name:"CollectionView",setup(G){const u=L(),{rows:a,loading:y,loadingMore:h,hasMore:d,resetAndLoad:k,loadMore:x}=T(),_=i(()=>y.value&&a.value.length===0),w=i(()=>u.query.page||"مجموعه"),C=i(()=>String(u.params.id??"")),l=F(null);let e;function m(){return{collectionId:C.value,sort:"newest"}}function P(){e==null||e.disconnect(),l.value&&(e=new IntersectionObserver(c=>{c.some(r=>r.isIntersecting)&&d.value&&x(m())},{rootMargin:"400px"}),e.observe(l.value))}return b(l,P),M(()=>e==null?void 0:e.disconnect()),V(async()=>{try{await k(m())}catch(c){console.log(c)}}),(c,r)=>{const I=H("container");return o(),n("div",U,[t(z,{title:w.value,"back-to":"search"},null,8,["title"]),t(g,{spinning:_.value,tip:"درحال دریافت اطلاعات"},{default:f(()=>[t(I,{class:"coll__body"},{default:f(()=>[t(A,{title:"محصولات این مجموعه",subtitle:"برای دیدن جزئیات، روی محصول ضربه بزنید"}),s(a).length?(o(),n("div",Y,[(o(!0),n(q,null,N(s(a),p=>(o(),O(R,{key:p.id,value:p},null,8,["value"]))),128))])):v("",!0),s(d)||s(h)?(o(),n("div",{key:1,ref_key:"sentinel",ref:l,class:"coll__more"},[t(g,{spinning:!0,indicator:!0,fixed:!1,tip:"",cls:"my-[10px]"})],512)):!_.value&&!s(a).length?(o(),n("section",j,[t(S,{icon:"vuesax-linear:box",size:"26"}),r[0]||(r[0]=E("p",null,"در این مجموعه محصولی ثبت نشده است.",-1))])):v("",!0)]),_:1})]),_:1},8,["spinning"])])}}}),Z=$(D,[["__scopeId","data-v-caef3082"]]);export{Z as default};