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>
2 lines
1.6 KiB
JavaScript
2 lines
1.6 KiB
JavaScript
import{d as g,j as h,o as y,Y as b,c as r,q as a,C as v,P as k,h as _,y as C,b as s,F as f,e as c,r as P,I as B,m as F,g as w,G as x,i as V,E as I,H as S,_ as N}from"./index-CW3p0GOu.js";import{P as $}from"./PageBar-DMRK3EvR.js";import{S as j}from"./SectionHead-BqQT521D.js";import{P as E}from"./ProductCard-C25sOeqt.js";const H={class:"favs"},R={class:"favs__grid"},q={key:1,class:"favs__empty"},z=g({__name:"FavoritesView",setup(G){const p=x(),i=h(),o=_(!1),n=_([]),l=V(()=>n.value.filter(t=>i.isFavorite(t.id)));async function d(){const t=i.ids;if(t.length===0){n.value=[];return}o.value=n.value.length===0;try{n.value=await C.getProductsByIds(t)}catch(e){console.log(e)}finally{o.value=!1}}return y(d),b(()=>i.ids.join(","),d),(t,e)=>{const m=I("container");return s(),r("div",H,[a($,{title:"علاقهمندی","back-to":"userPage::hasSubRoute"}),a(k,{spinning:o.value,tip:"در حال دریافت اطلاعات"},{default:v(()=>[a(m,{class:"favs__body"},{default:v(()=>[l.value.length?(s(),r(f,{key:0},[a(j,{title:"ذخیرهشدهها",subtitle:`${l.value.length} محصول`},null,8,["subtitle"]),c("div",R,[(s(!0),r(f,null,P(l.value,u=>(s(),S(E,{key:u.id,value:u},null,8,["value"]))),128))])],64)):o.value?w("",!0):(s(),r("section",q,[a(B,{icon:"vuesax-linear:heart",size:"26"}),e[1]||(e[1]=c("p",null,"هنوز محصولی را به علاقهمندیها اضافه نکردهاید.",-1)),c("button",{type:"button",class:"favs__emptyCta",onClick:e[0]||(e[0]=u=>F(p).push({name:"home"}))}," دیدن محصولات ")]))]),_:1})]),_:1},8,["spinning"])])}}}),D=N(z,[["__scopeId","data-v-30992de1"]]);export{D as default};
|