bring publish overrides into ui/index.jsx to fix api url being set properly
This commit is contained in:
parent
ab2ee079e2
commit
3f2de50368
3 changed files with 24 additions and 27 deletions
|
@ -1,25 +0,0 @@
|
||||||
import { Lbry } from 'lbry-redux';
|
|
||||||
import apiPublishCallViaWeb from './publish';
|
|
||||||
import { X_LBRY_AUTH_TOKEN } from '../../ui/constants/token';
|
|
||||||
|
|
||||||
const PROXY_PATH = 'api/v1/proxy';
|
|
||||||
export const SDK_API_URL = `${process.env.SDK_API_URL}/${PROXY_PATH}` || `https://api.lbry.tv/${PROXY_PATH}`;
|
|
||||||
|
|
||||||
Lbry.setDaemonConnectionString(SDK_API_URL);
|
|
||||||
|
|
||||||
Lbry.setOverride(
|
|
||||||
'publish',
|
|
||||||
params =>
|
|
||||||
new Promise((resolve, reject) => {
|
|
||||||
apiPublishCallViaWeb(
|
|
||||||
SDK_API_URL,
|
|
||||||
Lbry.getApiRequestHeaders() && Object.keys(Lbry.getApiRequestHeaders()).includes(X_LBRY_AUTH_TOKEN)
|
|
||||||
? Lbry.getApiRequestHeaders()[X_LBRY_AUTH_TOKEN]
|
|
||||||
: '',
|
|
||||||
'publish',
|
|
||||||
params,
|
|
||||||
resolve,
|
|
||||||
reject
|
|
||||||
);
|
|
||||||
})
|
|
||||||
);
|
|
25
ui/index.jsx
25
ui/index.jsx
|
@ -38,7 +38,30 @@ import { X_LBRY_AUTH_TOKEN } from 'constants/token';
|
||||||
import 'scss/all.scss';
|
import 'scss/all.scss';
|
||||||
|
|
||||||
// @if TARGET='web'
|
// @if TARGET='web'
|
||||||
import 'lbrytv/setup/api';
|
// These overrides can't live in lbrytv/ because they need to use the same instance of `Lbry`
|
||||||
|
import apiPublishCallViaWeb from 'lbrytv/setup/publish';
|
||||||
|
|
||||||
|
const PROXY_PATH = 'api/v1/proxy';
|
||||||
|
export const SDK_API_URL = `${process.env.SDK_API_URL}/${PROXY_PATH}` || `https://api.lbry.tv/${PROXY_PATH}`;
|
||||||
|
|
||||||
|
Lbry.setDaemonConnectionString(SDK_API_URL);
|
||||||
|
|
||||||
|
Lbry.setOverride(
|
||||||
|
'publish',
|
||||||
|
params =>
|
||||||
|
new Promise((resolve, reject) => {
|
||||||
|
apiPublishCallViaWeb(
|
||||||
|
SDK_API_URL,
|
||||||
|
Lbry.getApiRequestHeaders() && Object.keys(Lbry.getApiRequestHeaders()).includes(X_LBRY_AUTH_TOKEN)
|
||||||
|
? Lbry.getApiRequestHeaders()[X_LBRY_AUTH_TOKEN]
|
||||||
|
: '',
|
||||||
|
'publish',
|
||||||
|
params,
|
||||||
|
resolve,
|
||||||
|
reject
|
||||||
|
);
|
||||||
|
})
|
||||||
|
);
|
||||||
// @endif
|
// @endif
|
||||||
|
|
||||||
const startTime = Date.now();
|
const startTime = Date.now();
|
||||||
|
|
|
@ -438,7 +438,6 @@ export function doAnalyticsView(uri, timeToStart) {
|
||||||
export function doSignIn() {
|
export function doSignIn() {
|
||||||
return (dispatch, getState) => {
|
return (dispatch, getState) => {
|
||||||
// @if TARGET='web'
|
// @if TARGET='web'
|
||||||
debugger;
|
|
||||||
dispatch(doBalanceSubscribe());
|
dispatch(doBalanceSubscribe());
|
||||||
dispatch(doFetchChannelListMine());
|
dispatch(doFetchChannelListMine());
|
||||||
// @endif
|
// @endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue