import e from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/regenerator";import{fetchUserSettings as r}from"../../../api/user-settings/fetchUserSettings.js";import"@babel/runtime/helpers/defineProperty";import"../../../../../clients/jsonApi/index.js";var n=function(){var n=e(t.mark((function e(n,a){var o;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a){e.next=3;break}return n.setState({loadState:"loaded"}),e.abrupt("return");case 3:return n.setState({loadState:"loading",error:null}),e.prev=4,e.next=7,r(a);case 7:o=e.sent,n.setState({settings:null!=o?o:{},loadState:"loaded",manuallyChanged:o?Object.keys(o).reduce((function(e,t){return e[t]=!0,e}),{}):{}}),e.next=14;break;case 11:e.prev=11,e.t0=e.catch(4),n.setState({loadState:"error",error:e.t0});case 14:case"end":return e.stop()}}),e,null,[[4,11]])})));return function(e,t){return n.apply(this,arguments)}}();export{n as loadUserSettings};
//# sourceMappingURL=loadUserSettings.js.map
