Module 612630

575 characters · in 309486b963b62618.js
Dependencies
Lazily required by (0)none
Lazily requires (0)none
Source Raw
function(t,e,r){r.d(e,{A:()=>h});var o=r(582128),i=r(17928),s=r(562465),n=r(228366),c=r(279263),d=r(652215);function h(t){let e=(0,i.bG)([c.A],()=>c.A.getNote(t));return o.useEffect(()=>{null==e&&a(t)},[e,t]),e??{loading:!0,note:null}}async function a(t){n.h.dispatch({type:"USER_NOTE_LOAD_START",userId:t});try{let{body:e}=await s.Bo.get({url:d.Rsh.NOTE(t),oldFormErrors:!0,rejectWithError:!0});if(e.note_user_id!==t)throw Error("Invalid response from server");n.h.dispatch({type:"USER_NOTE_UPDATE",id:t,note:e.note})}catch(e){n.h.dispatch({type:"USER_NOTE_UPDATE",id:t})}}}