use v2 endpoint for lbry.tv status

This commit is contained in:
Sean Yesmunt 2020-06-22 12:20:13 -04:00
parent 684d0e302c
commit dcfdbd6352

View file

@ -11,7 +11,11 @@ export const STATUS_DOWN = 'down';
export function useDegradedPerformance(onDegradedPerformanceCallback) {
useEffect(() => {
fetchWithTimeout(STATUS_TIMEOUT_LIMIT, fetch(`${SDK_API_PATH}/status`))
// The status endpoint is the only endpoint at "v2" currently
// This should be moved into the config once more endpoints are using it
const STATUS_ENDPOINT = `${SDK_API_PATH}/status`.replace('v1', 'v2');
fetchWithTimeout(STATUS_TIMEOUT_LIMIT, fetch(STATUS_ENDPOINT))
.then(response => response.json())
.then(status => {
if (status.general_state !== STATUS_OK) {