2017-05-17 23:52:45 +02:00
|
|
|
import * as types from 'constants/action_types'
|
|
|
|
import lbry from 'lbry'
|
|
|
|
|
|
|
|
export function doFetchDaemonSettings() {
|
|
|
|
return function(dispatch, getState) {
|
2017-06-02 18:57:23 +02:00
|
|
|
lbry.settings_get().then((settings) => {
|
2017-05-17 23:52:45 +02:00
|
|
|
dispatch({
|
|
|
|
type: types.DAEMON_SETTINGS_RECEIVED,
|
|
|
|
data: {
|
|
|
|
settings
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export function doSetDaemonSetting(key, value) {
|
|
|
|
return function(dispatch, getState) {
|
|
|
|
let settings = {};
|
|
|
|
settings[key] = value;
|
|
|
|
lbry.settings_set(settings).then(settings)
|
2017-06-05 16:44:53 +02:00
|
|
|
lbry.settings_get().then((settings) => {
|
2017-05-17 23:52:45 +02:00
|
|
|
dispatch({
|
|
|
|
type: types.DAEMON_SETTINGS_RECEIVED,
|
|
|
|
data: {
|
|
|
|
settings
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|