All Downloads are FREE. Search and download functionalities are using the official Maven repository.

theme.keycloak.v2.admin.resources.assets.UserProfileContext-2c96f79e.js Maven / Gradle / Ivy

There is a newer version: 25.0.1
Show newest version
import{dd as C,c as S,d as U,u as h,r,q as p,j as y,g as n,A,de as E}from"./index-0cda761d.js";const u=C("UserProfileContext",void 0),R=({children:c})=>{const{realm:t}=S(),{addAlert:i,addError:l}=U(),{t:f}=h(),[d,g]=r.useState(null),[a,P]=r.useState(0),[m,e]=r.useState(!1);p(()=>n.users.getProfile({realm:t}),s=>g(s),[a]);const v=async(s,o)=>{e(!0);try{return await n.users.updateProfile({...s,realm:t}),e(!1),P(a+1),i(f(o?.successMessageKey??"realm-settings:userProfileSuccess"),A.success),!0}catch(x){return e(!1),l(o?.errorMessageKey??"realm-settings:userProfileError",x),!1}};return y.jsx(u.Provider,{value:{config:d,save:v,isSaving:m},children:c})},K=()=>E(u);export{R as U,K as u};
//# sourceMappingURL=UserProfileContext-2c96f79e.js.map




© 2015 - 2024 Weber Informatics LLC | Privacy Policy