From 0a92b62fb7a220f9924c65795e79d9f4b7cc300d Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Thu, 24 Oct 2019 14:07:48 -0400 Subject: [PATCH] persist everything on tv --- src/ui/index.jsx | 37 +++++++++++++++++++------------------ src/ui/store.js | 8 ++------ 2 files changed, 21 insertions(+), 24 deletions(-) diff --git a/src/ui/index.jsx b/src/ui/index.jsx index 75eeee1b0..9db259e43 100644 --- a/src/ui/index.jsx +++ b/src/ui/index.jsx @@ -97,27 +97,28 @@ Lbryio.setOverride( 'getAuthToken', () => new Promise(resolve => { + // @if TARGET='app' if (authToken) { resolve(authToken); - } else { - // @if TARGET='app' - ipcRenderer.once('auth-token-response', (event, token) => { - Lbryio.authToken = token; - resolve(token); - }); - - ipcRenderer.send('get-auth-token'); - // @endif - // @if TARGET='web' - const authToken = getAuthToken(); - - if (authToken) { - Lbry.setApiHeader(X_LBRY_AUTH_TOKEN, authToken); - } - - resolve(authToken); - // @endif } + + ipcRenderer.once('auth-token-response', (event, token) => { + Lbryio.authToken = token; + resolve(token); + }); + + ipcRenderer.send('get-auth-token'); + // @endif + + // @if TARGET='web' + const authTokenToReturn = authToken || getAuthToken(); + + if (authTokenToReturn !== null) { + Lbry.setApiHeader(X_LBRY_AUTH_TOKEN, authTokenToReturn); + } + + resolve(authTokenToReturn); + // @endif }) ); diff --git a/src/ui/store.js b/src/ui/store.js index 59e8a2a12..2926921fc 100644 --- a/src/ui/store.js +++ b/src/ui/store.js @@ -57,12 +57,10 @@ const tagsFilter = createFilter('tags', ['followedTags']); const subscriptionsFilter = createFilter('subscriptions', ['subscriptions']); const blockedFilter = createFilter('blocked', ['blockedChannels']); const whiteListedReducers = [ - // @if TARGET='app' + 'fileInfo', 'publish', 'wallet', 'tags', - // 'fileInfo', - // @endif 'content', 'app', 'search', @@ -72,12 +70,10 @@ const whiteListedReducers = [ ]; const transforms = [ - // @if TARGET='app' - walletFilter, fileInfoFilter, + walletFilter, blockedFilter, tagsFilter, - // @endif appFilter, searchFilter, tagsFilter,