passes apicall for lbrytv updates

This commit is contained in:
jessop 2019-11-15 14:42:31 -05:00 committed by Sean Yesmunt
parent 0bcb3f7b68
commit 04181c8a4a
2 changed files with 3 additions and 2 deletions

View file

@ -7,12 +7,12 @@
*/ */
import { X_LBRY_AUTH_TOKEN } from '../../ui/constants/token'; import { X_LBRY_AUTH_TOKEN } from '../../ui/constants/token';
import { doUpdateUploadProgress } from 'lbryinc'; import { doUpdateUploadProgress } from 'lbryinc';
import { apiCall } from 'lbry-redux';
// A modified version of Lbry.apiCall that allows // A modified version of Lbry.apiCall that allows
// to perform calling methods at arbitrary urls // to perform calling methods at arbitrary urls
// and pass form file fields // and pass form file fields
export default function apiPublishCallViaWeb( export default function apiPublishCallViaWeb(
apiCall: (any) => void,
connectionString: string, connectionString: string,
token: string, token: string,
method: string, method: string,

View file

@ -12,7 +12,7 @@ import React, { Fragment, useState, useEffect } from 'react';
import ReactDOM from 'react-dom'; import ReactDOM from 'react-dom';
import { Provider } from 'react-redux'; import { Provider } from 'react-redux';
import { doConditionalAuthNavigate, doDaemonReady, doAutoUpdate, doOpenModal, doHideModal } from 'redux/actions/app'; import { doConditionalAuthNavigate, doDaemonReady, doAutoUpdate, doOpenModal, doHideModal } from 'redux/actions/app';
import { Lbry, doToast, isURIValid, setSearchApi } from 'lbry-redux'; import { Lbry, doToast, isURIValid, setSearchApi, apiCall } from 'lbry-redux';
import { doSetLanguage, doUpdateIsNightAsync } from 'redux/actions/settings'; import { doSetLanguage, doUpdateIsNightAsync } from 'redux/actions/settings';
import { import {
doAuthenticate, doAuthenticate,
@ -51,6 +51,7 @@ Lbry.setOverride(
params => params =>
new Promise((resolve, reject) => { new Promise((resolve, reject) => {
apiPublishCallViaWeb( apiPublishCallViaWeb(
apiCall,
SDK_API_URL, SDK_API_URL,
Lbry.getApiRequestHeaders() && Object.keys(Lbry.getApiRequestHeaders()).includes(X_LBRY_AUTH_TOKEN) Lbry.getApiRequestHeaders() && Object.keys(Lbry.getApiRequestHeaders()).includes(X_LBRY_AUTH_TOKEN)
? Lbry.getApiRequestHeaders()[X_LBRY_AUTH_TOKEN] ? Lbry.getApiRequestHeaders()[X_LBRY_AUTH_TOKEN]