Fix fetching daemon settings bug
This commit is contained in:
parent
47bdc6cbef
commit
f3c92acacf
1 changed files with 7 additions and 7 deletions
|
@ -1,10 +1,10 @@
|
||||||
import * as ACTIONS from 'constants/action_types';
|
import * as ACTIONS from 'constants/action_types';
|
||||||
import * as SETTINGS from 'constants/settings';
|
import * as SETTINGS from 'constants/settings';
|
||||||
|
|
||||||
import Lbry from 'lbry';
|
|
||||||
import Fs from 'fs';
|
import Fs from 'fs';
|
||||||
import Http from 'http';
|
import Http from 'http';
|
||||||
|
|
||||||
|
import Lbry from 'lbry';
|
||||||
|
|
||||||
export function doFetchDaemonSettings() {
|
export function doFetchDaemonSettings() {
|
||||||
return function(dispatch) {
|
return function(dispatch) {
|
||||||
Lbry.settings_get().then(settings => {
|
Lbry.settings_get().then(settings => {
|
||||||
|
@ -20,14 +20,14 @@ export function doFetchDaemonSettings() {
|
||||||
|
|
||||||
export function doSetDaemonSetting(key, value) {
|
export function doSetDaemonSetting(key, value) {
|
||||||
return function(dispatch) {
|
return function(dispatch) {
|
||||||
const settings = {};
|
const newSettings = {};
|
||||||
settings[key] = value;
|
newSettings[key] = value;
|
||||||
Lbry.settings_set(settings).then(settings);
|
Lbry.settings_set(newSettings).then(newSettings);
|
||||||
Lbry.settings_get().then(remoteSettings => {
|
Lbry.settings_get().then(settings => {
|
||||||
dispatch({
|
dispatch({
|
||||||
type: ACTIONS.DAEMON_SETTINGS_RECEIVED,
|
type: ACTIONS.DAEMON_SETTINGS_RECEIVED,
|
||||||
data: {
|
data: {
|
||||||
remoteSettings,
|
settings,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue