mirror of
https://github.com/LBRYFoundation/lbry-desktop.git
synced 2025-08-28 07:51:31 +00:00
32 lines
612 B
JavaScript
32 lines
612 B
JavaScript
import * as types from 'constants/action_types'
|
|
import lbry from 'lbry'
|
|
|
|
export function doFetchCostInfoForUri(uri) {
|
|
return function(dispatch, getState) {
|
|
dispatch({
|
|
type: types.FETCH_COST_INFO_STARTED,
|
|
data: {
|
|
uri,
|
|
}
|
|
})
|
|
|
|
lbry.getCostInfo(uri).then(costInfo => {
|
|
dispatch({
|
|
type: types.FETCH_COST_INFO_COMPLETED,
|
|
data: {
|
|
uri,
|
|
costInfo,
|
|
}
|
|
})
|
|
}).catch(() => {
|
|
dispatch({
|
|
type: types.FETCH_COST_INFO_COMPLETED,
|
|
data: {
|
|
uri,
|
|
costInfo: null
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|