Fix Flipper lints #1

Summary: More lints.

Reviewed By: lblasa

Differential Revision: D30769201

fbshipit-source-id: 38089363ffb894171d386eaa80055c5d8d59500f
This commit is contained in:
Pascal Hartig
2021-09-07 07:30:19 -07:00
committed by Facebook GitHub Bot
parent e25103291a
commit e2122e395b
4 changed files with 19 additions and 15 deletions

View File

@@ -143,7 +143,10 @@ function InstallButton(props: {
try {
await fn();
} catch (err) {
console.error(err);
console.error(
`Installation process of kind ${actionKind} failed with:`,
err,
);
setAction({kind: actionKind, error: err.toString()});
}
};
@@ -293,18 +296,18 @@ function useNPMSearch(
useEffect(() => {
(async () => {
let cancelled = false;
let canceled = false;
const updatablePlugins = await reportPlatformFailures(
getUpdatablePlugins(query),
`${TAG}:queryIndex`,
);
if (cancelled) {
if (canceled) {
return;
}
setSearchResults(updatablePlugins);
// Clean up: if query changes while we're searching, abandon results.
return () => {
cancelled = true;
canceled = true;
};
})();
}, [query, installedPlugins]);
@@ -320,10 +323,9 @@ export default connect<PropsFromState, DispatchFromProps, OwnProps, AppState>(
installedPlugins,
}),
(dispatch: Dispatch<Action<any>>) => ({
refreshInstalledPlugins: () => {
getInstalledPlugins().then((plugins) =>
dispatch(registerInstalledPlugins(plugins)),
);
refreshInstalledPlugins: async () => {
const plugins = await getInstalledPlugins();
dispatch(registerInstalledPlugins(plugins));
},
}),
)(PluginInstaller);

View File

@@ -56,7 +56,7 @@ export default function PluginPackageInstaller({
await onInstall();
} catch (e) {
setError(e);
console.error(e);
console.error('PluginPackageInstaller install error:', e);
} finally {
setInProgress(false);
}

View File

@@ -15,7 +15,7 @@ const IndentedSection = styled(FlexColumn)({
paddingLeft: 50,
paddingBottom: 10,
});
const GreyedOutOverlay = styled.div({
const GrayedOutOverlay = styled.div({
background: theme.backgroundDefault,
borderRadius: 4,
opacity: 0.6,
@@ -41,11 +41,11 @@ export default function ToggledSection(props: {
onClick={() => props.onChange && props.onChange(!props.toggled)}
toggled={props.toggled}
/>
{props.frozen && <GreyedOutOverlay />}
{props.frozen && <GrayedOutOverlay />}
</FlexRow>
<IndentedSection>
{props.children}
{props.toggled || props.frozen ? null : <GreyedOutOverlay />}
{props.toggled || props.frozen ? null : <GrayedOutOverlay />}
</IndentedSection>
</FlexColumn>
);

View File

@@ -19,6 +19,8 @@ import {
} from '../../ui';
import React, {useState} from 'react';
import {promises as fs} from 'fs';
// Used for dialogs.
// eslint-disable-next-line flipper/no-electron-remote-imports
import {remote} from 'electron';
import path from 'path';
@@ -49,7 +51,7 @@ const CenteredGlyph = styled(Glyph)({
marginLeft: 10,
});
const GreyedOutOverlay = styled.div({
const GrayedOutOverlay = styled.div({
backgroundColor: '#EFEEEF',
borderRadius: 4,
opacity: 0.6,
@@ -129,7 +131,7 @@ export function FilePathConfigField(props: {
{isValid ? null : (
<CenteredGlyph name="caution-triangle" color={colors.yellow} />
)}
{props.frozen && <GreyedOutOverlay />}
{props.frozen && <GrayedOutOverlay />}
</ConfigFieldContainer>
);
}
@@ -138,7 +140,7 @@ export function ConfigText(props: {content: string; frozen?: boolean}) {
return (
<ConfigFieldContainer>
<InfoText>{props.content}</InfoText>
{props.frozen && <GreyedOutOverlay />}
{props.frozen && <GrayedOutOverlay />}
</ConfigFieldContainer>
);
}