PageSourceSearch

https://www.stuffthatworks.health/static/NotificationFrequencyPage-BtCRVwdy.js

js stuffthatworks.health collected 2026-10-02 04:18:44 UTC 1,995 bytes, 2 lines download raw bytes

1import{Y as F,r as e,T as t}from"./vendor-BULYPieG.js";import{b5 as N,d6 as q,ax as I,aK as k,F as v,cq as T}from"./index-cNMbgwTF.js";import{C as g}from"./CircularLoadingBar-BhHujCyI.js";import{F as s,u as j}from"./useFetchRequestInfo-B9CdWVNH.js";import{R}from"./RadioGroup-Cfs9fPhE.js";import"./axios-DM81IqoM.js";import"./index-DE-k_iRt.js";import"./withFormControlContext-bdvWlJl9.js";import"./index-_ZpzHypC.js";import"./SwitchBase-DTBs9EOl.js";import"./index-CLrdreZM.js";import"./index-CDsYt-OB.js";import"./index-DA9L1f2l.js";import"./App-BsSdbzRg.js";import"./_createAssigner-BYa6ISqC.js";import"./sumBy-DixUPtWG.js";import"./_baseOrderBy-C7H6rSJt.js";const V=()=>{const f=F(),{texts:n,setNotFound:m}=e.useContext(N),[c,p]=e.useState(!1),[u,y]=e.useState(s.DAILY),a=q("daily",f.location.search),i=q("weekly",f.location.search),{notificationGroup:d,error:l,startFrequency:h}=j(a),E=n.notification.frequency_question,o=e.useCallback(r=>{I(`Failed to set notification preference ${r.message}`,{error:r}),m()},[m]);e.useEffect(()=>{y(h)},[h]),e.useEffect(()=>{(!a||!i)&&o("no frequency search params")},[a,i,o]),e.useEffect(()=>{l&&o(l)},[l,o]),e.useEffect(()=>{c&&setTimeout(()=>p(!1),3e3)},[c]);const x=e.useCallback(async()=>{try{await k(v.NOTIFICATION_PREFERENCE,{encodedToken:u===s.WEEKLY?i:a}),p(!0)}catch(r){o(r)}},[o,i,a,u]);return d?t.jsxs("div",{className:"notification-frequency-wrapper",children:[t.jsx("div",{className:"notification-frequency-title",children:E.replace("%NOTIFICATION%",d)}),t.jsx("form",{className:"notification-frequency-form",children:t.jsx(R,{value:u,onChange:(r,C)=>y(C),options:[{label:"daily",value:s.DAILY},{label:"weekly",value:s.WEEKLY}]})}),t.jsx(T,{variant:"contained",onClick:x,children:n.common.actions.save}),c&&t.jsx("div",{className:"notification-frequency-status",children:n.notification.frequency_changed})]}):t.jsx(g,{className:"loading"})};export{V as NotificationFrequency};
2//# sourceMappingURL=NotificationFrequencyPage-BtCRVwdy.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.