Module 612630

587 characters · in no known chunk
Dependencies
Required by (3)
Lazily required by (0)none
Lazily requires (0)none
Source Raw
function(e,t,n){"use strict";n.d(t,{A:()=>u});var r=n(64700),i=n(311907),s=n(562465),a=n(73153),o=n(279263),l=n(652215);function u(e){let t=(0,i.bG)([o.A],()=>o.A.getNote(e));return r.useEffect(()=>{null==t&&c(e)},[t,e]),t??{loading:!0,note:null}}async function c(e){a.h.dispatch({type:"USER_NOTE_LOAD_START",userId:e});try{let{body:t}=await s.Bo.get({url:l.Rsh.NOTE(e),oldFormErrors:!0,rejectWithError:!0});if(t.note_user_id!==e)throw Error("Invalid response from server");a.h.dispatch({type:"USER_NOTE_UPDATE",id:e,note:t.note})}catch(t){a.h.dispatch({type:"USER_NOTE_UPDATE",id:e})}}}