mirror of
https://github.com/ascribe/onion.git
synced 2024-12-22 17:33:14 +01:00
30 lines
691 B
JavaScript
30 lines
691 B
JavaScript
'use strict';
|
|
|
|
import alt from '../alt';
|
|
import WhitelabelFetcher from '../fetchers/whitelabel_fetcher';
|
|
|
|
|
|
class WhitelabelActions {
|
|
constructor() {
|
|
this.generateActions(
|
|
'updateWhitelabel'
|
|
);
|
|
}
|
|
|
|
fetchWhitelabel() {
|
|
WhitelabelFetcher.fetch()
|
|
.then((res) => {
|
|
if(res && res.whitelabel) {
|
|
this.actions.updateWhitelabel(res.whitelabel);
|
|
} else {
|
|
this.actions.updateWhitelabel({});
|
|
}
|
|
})
|
|
.catch((err) => {
|
|
console.logGlobal(err);
|
|
});
|
|
}
|
|
}
|
|
|
|
export default alt.createActions(WhitelabelActions);
|