From 5c906df371a02cceeee1de2df772245e0f0c1c60 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Thu, 16 Jan 2020 17:03:41 -0500 Subject: [PATCH] cleanup --- electron/index.js | 15 +--------- static/app-strings.json | 2 +- ui/index.jsx | 18 ------------ ui/modal/modalDownloading/view.jsx | 4 +-- ui/util/saved-passwords.js | 45 ++++++++++++++++++++---------- 5 files changed, 34 insertions(+), 50 deletions(-) diff --git a/electron/index.js b/electron/index.js index 6851f2047..8ef3776f7 100644 --- a/electron/index.js +++ b/electron/index.js @@ -318,14 +318,9 @@ ipcMain.on('version-info-requested', () => { requestLatestRelease(); }); + // In a few months, we can remove the keytar dependency and below calls once // enough users have moved over to cookies -ipcMain.on('get-auth-token', event => { - keytar.getPassword('LBRY', 'auth_token').then(token => { - event.sender.send('auth-token-response', token ? token.toString().trim() : null); - }); -}); - ipcMain.on('delete-auth-token', (event, password) => { keytar.deletePassword('LBRY', 'auth_token', password).then(res => { event.sender.send('delete-auth-token-response', res); @@ -338,14 +333,6 @@ ipcMain.on('get-password', event => { }); }); -ipcMain.on('set-password', (event, password) => { - if (password || password === '') { - keytar.setPassword('LBRY', 'wallet_password', password).then(res => { - event.sender.send('set-password-response', res); - }); - } -}); - ipcMain.on('delete-password', event => { keytar.deletePassword('LBRY', 'wallet_password').then(res => { event.sender.send('delete-password-response', res); diff --git a/static/app-strings.json b/static/app-strings.json index 00d8d3ccf..a63b6e3b8 100644 --- a/static/app-strings.json +++ b/static/app-strings.json @@ -909,4 +909,4 @@ "This is an experiment, and may be removed in the future. Publish something with the #homepagecagematch tag to battle for the top spot on the home page!": "This is an experiment, and may be removed in the future. Publish something with the #homepagecagematch tag to battle for the top spot on the home page!", "%claimsInChannel% publishes": "%claimsInChannel% publishes", "%claimsInChannel% publish": "%claimsInChannel% publish" -} \ No newline at end of file +} diff --git a/ui/index.jsx b/ui/index.jsx index f0fe7fe2b..c7d8e1310 100644 --- a/ui/index.jsx +++ b/ui/index.jsx @@ -108,7 +108,6 @@ Lbryio.setOverride( authToken = response.auth_token; setAuthToken(authToken); - resolve(authToken); }); }) @@ -118,23 +117,6 @@ Lbryio.setOverride( 'getAuthToken', () => new Promise(resolve => { - // @if TARGET='app' - // NEED TO DO SOMETHING HERE TO CHECK FOR A COOKIE AUTH TOKEN. - // IF IT EXISTS, SKIP AND CONTINUE BELOW THE @ENDIF - // IF NOT, COPY THE KEYTAR AUTH TOKEN AND PASSWORD TO THE COOKIE (SetAuthToken/SetPassword?) - // AND THEN DELETE KEYTAR ONE (Or leave for now?) - if (authToken) { - resolve(authToken); - } - - ipcRenderer.once('auth-token-response', (event, token) => { - Lbryio.authToken = token; - resolve(token); - }); - - ipcRenderer.send('get-auth-token'); - // @endif - const authTokenToReturn = authToken || getAuthToken(); if (authTokenToReturn !== null) { diff --git a/ui/modal/modalDownloading/view.jsx b/ui/modal/modalDownloading/view.jsx index 1629f25a6..62120303f 100644 --- a/ui/modal/modalDownloading/view.jsx +++ b/ui/modal/modalDownloading/view.jsx @@ -35,9 +35,7 @@ class ModalDownloading extends React.PureComponent {

{__('After the install is complete, please reopen the app.')}

{__('Note: You can also install the AppImage version for streamlined updates.')}{' '} - -