Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion web/packages/design/src/Card/Card.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const Card = styled(Box)`
`;

Card.defaultProps = {
theme: { darkTheme },
theme: darkTheme,
};

Card.displayName = 'Card';
Expand Down
12 changes: 8 additions & 4 deletions web/packages/teleterm/src/mainProcess/resolveNetworkAddress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ function waitForMatchInStdout(
const removeListeners = () => {
process.stdout.off('data', findAddressInChunk);
process.off('error', rejectOnError);
process.off('exit', rejectOnExit);
process.off('close', rejectOnClose);
clearTimeout(timeout);
};

Expand All @@ -97,14 +97,14 @@ function waitForMatchInStdout(
removeListeners();
};

const rejectOnExit = (code: number, signal: NodeJS.Signals) => {
const rejectOnClose = (code: number, signal: NodeJS.Signals) => {
const codeOrSignal = [
// code can be 0, so we cannot just check it the same way as the signal.
code != null && `code ${code}`,
signal && `signal ${signal}`,
]
.filter(Boolean)
.join(' and ');
.join(' ');
const details = codeOrSignal ? ` with ${codeOrSignal}` : '';
rejectOnError(
new ResolveError(
Expand All @@ -117,7 +117,11 @@ function waitForMatchInStdout(

process.stdout.on('data', findAddressInChunk);
process.on('error', rejectOnError);
process.on('exit', rejectOnExit);
// Listen for close instead of exit. This doesn't make much difference in prod usage, but it's
// meaningful in tests. testProcess.mjs exits soon after printing to stdout, so we have to make
// sure that stdio streams are closed to avoid process.on('exit') being processed before
// stdout.on('data').
process.on('close', rejectOnClose);
});
}

Expand Down
7 changes: 5 additions & 2 deletions web/packages/teleterm/src/ui/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ import { AppInitializer } from 'teleterm/ui/AppInitializer';
import CatchError from './components/CatchError';
import AppContextProvider from './appContextProvider';
import AppContext from './appContext';
import { ThemeProvider } from './ThemeProvider';
import { StaticThemeProvider, ThemeProvider } from './ThemeProvider';
import { darkTheme } from './ThemeProvider/theme';

export const App: React.FC<{ ctx: AppContext }> = ({ ctx }) => {
return (
Expand All @@ -47,7 +48,9 @@ export const App: React.FC<{ ctx: AppContext }> = ({ ctx }) => {
export const FailedApp = (props: { message: string }) => {
return (
<StyledApp>
<Failed alignSelf={'baseline'} message={props.message} />
<StaticThemeProvider theme={darkTheme}>
<Failed alignSelf={'baseline'} message={props.message} />
</StaticThemeProvider>
</StyledApp>
);
};
Expand Down