Disk space ipc fixes #7610

Merged
jessopb merged 2 commits from disk-space-ipc-fixes into master 2022-06-10 18:42:50 +02:00
4 changed files with 6 additions and 6 deletions

View file

@ -323,7 +323,7 @@ ipcMain.on('get-disk-space', async (event) => {
rendererWindow.webContents.send('send-disk-space', { diskSpace }); rendererWindow.webContents.send('send-disk-space', { diskSpace });
} catch (e) { } catch (e) {
rendererWindow.webContents.send('send-disk-space', { error: e.message || e }); rendererWindow.webContents.send('send-disk-space', { error: e.message || e });
console.log('Failed to start LbryFirst', e); console.log('Failed to get disk space', e);
} }
}); });

View file

@ -1,6 +1,7 @@
// @flow // @flow
import * as React from 'react'; import * as React from 'react';
import I18nMessage from 'component/i18nMessage'; import I18nMessage from 'component/i18nMessage';
import { ipcRenderer } from 'electron';
type Props = { type Props = {
// --- select --- // --- select ---
@ -14,6 +15,9 @@ type Props = {
function StorageViz(props: Props) { function StorageViz(props: Props) {
const { diskSpace, viewHostingLimit, autoHostingLimit, viewBlobSpace, autoBlobSpace, privateBlobSpace } = props; const { diskSpace, viewHostingLimit, autoHostingLimit, viewBlobSpace, autoBlobSpace, privateBlobSpace } = props;
React.useEffect(() => {
ipcRenderer.send('get-disk-space');
}, []);
if (!diskSpace || !diskSpace.total) { if (!diskSpace || !diskSpace.total) {
return ( return (

View file

@ -103,8 +103,6 @@ ipcRenderer.on('send-disk-space', (event, result) => {
} }
}); });
ipcRenderer.send('get-disk-space');
// @if TARGET='app'
ipcRenderer.on('open-uri-requested', (event, url, newSession) => { ipcRenderer.on('open-uri-requested', (event, url, newSession) => {
function handleError() { function handleError() {
app.store.dispatch( app.store.dispatch(
@ -191,7 +189,6 @@ document.addEventListener('click', (event) => {
target = target.parentNode; target = target.parentNode;
} }
}); });
// @endif
document.addEventListener('dragover', (event) => { document.addEventListener('dragover', (event) => {
event.preventDefault(); event.preventDefault();

View file

@ -341,7 +341,6 @@ export function doDaemonReady() {
); );
dispatch({ type: ACTIONS.DAEMON_READY }); dispatch({ type: ACTIONS.DAEMON_READY });
// @if TARGET='app'
dispatch(doBalanceSubscribe()); dispatch(doBalanceSubscribe());
dispatch(doSetAutoLaunch()); dispatch(doSetAutoLaunch());
dispatch(doFindFFmpeg()); dispatch(doFindFFmpeg());
@ -352,7 +351,7 @@ export function doDaemonReady() {
dispatch(doCheckUpgradeAvailable()); dispatch(doCheckUpgradeAvailable());
} }
dispatch(doCheckUpgradeSubscribe()); dispatch(doCheckUpgradeSubscribe());
// @endif ipcRenderer.send('get-disk-space');
}; };
} }