persist everything on tv

This commit is contained in:
Sean Yesmunt 2019-10-24 14:07:48 -04:00
parent a0f4bf7830
commit 0a92b62fb7
2 changed files with 21 additions and 24 deletions

View file

@ -97,10 +97,11 @@ Lbryio.setOverride(
'getAuthToken', 'getAuthToken',
() => () =>
new Promise(resolve => { new Promise(resolve => {
// @if TARGET='app'
if (authToken) { if (authToken) {
resolve(authToken); resolve(authToken);
} else { }
// @if TARGET='app'
ipcRenderer.once('auth-token-response', (event, token) => { ipcRenderer.once('auth-token-response', (event, token) => {
Lbryio.authToken = token; Lbryio.authToken = token;
resolve(token); resolve(token);
@ -108,16 +109,16 @@ Lbryio.setOverride(
ipcRenderer.send('get-auth-token'); ipcRenderer.send('get-auth-token');
// @endif // @endif
// @if TARGET='web' // @if TARGET='web'
const authToken = getAuthToken(); const authTokenToReturn = authToken || getAuthToken();
if (authToken) { if (authTokenToReturn !== null) {
Lbry.setApiHeader(X_LBRY_AUTH_TOKEN, authToken); Lbry.setApiHeader(X_LBRY_AUTH_TOKEN, authTokenToReturn);
} }
resolve(authToken); resolve(authTokenToReturn);
// @endif // @endif
}
}) })
); );

View file

@ -57,12 +57,10 @@ const tagsFilter = createFilter('tags', ['followedTags']);
const subscriptionsFilter = createFilter('subscriptions', ['subscriptions']); const subscriptionsFilter = createFilter('subscriptions', ['subscriptions']);
const blockedFilter = createFilter('blocked', ['blockedChannels']); const blockedFilter = createFilter('blocked', ['blockedChannels']);
const whiteListedReducers = [ const whiteListedReducers = [
// @if TARGET='app' 'fileInfo',
'publish', 'publish',
'wallet', 'wallet',
'tags', 'tags',
// 'fileInfo',
// @endif
'content', 'content',
'app', 'app',
'search', 'search',
@ -72,12 +70,10 @@ const whiteListedReducers = [
]; ];
const transforms = [ const transforms = [
// @if TARGET='app'
walletFilter,
fileInfoFilter, fileInfoFilter,
walletFilter,
blockedFilter, blockedFilter,
tagsFilter, tagsFilter,
// @endif
appFilter, appFilter,
searchFilter, searchFilter,
tagsFilter, tagsFilter,