import{t as s,r as y,b$ as f}from"./index-Ef5HIHwv.js";function l(u){const e=s(),{entity_type:n,entity_id:a,kinds:t,enabled:r=!0}=u,c=(t==null?void 0:t.join(","))||"";y.useEffect(()=>{if(!r)return;let o=!1;return f({entity_type:n,entity_id:a,kinds:t}).then(i=>{o||(i==null?void 0:i.marked_read)>0&&(e.invalidateQueries({queryKey:["notifications"]}),e.invalidateQueries({queryKey:["notification-counts-v2"]}))}).catch(()=>{}),()=>{o=!0}},[n,a,c,r,e])}export{l as u};
