Skip to content

Commit ee5406c

Browse files
lbogdanCompuIves
authored andcommitted
Console enhancements. (codesandbox#290)
1 parent 021d64c commit ee5406c

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

src/app/components/sandbox/Preview/DevTools/Console/Message.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const inspectorTheme = {
1616
BASE_FONT_SIZE: '14px',
1717
BASE_LINE_HEIGHT: '18px',
1818

19-
BASE_BACKGROUND_COLOR: theme.background(),
19+
BASE_BACKGROUND_COLOR: 'rgba(0, 0, 0, 0)',
2020
BASE_COLOR: 'rgb(213, 213, 213)',
2121

2222
OBJECT_NAME_COLOR: theme.secondary(),

src/app/components/sandbox/Preview/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* @flow */
22
import * as React from 'react';
33
import styled from 'styled-components';
4-
import { listen } from 'codesandbox-api';
4+
import { listen, dispatch } from 'codesandbox-api';
55

66
import { debounce } from 'lodash';
77

@@ -267,6 +267,7 @@ export default class Preview extends React.PureComponent<Props, State> {
267267
} = this.props;
268268
if (preferences.clearConsoleEnabled) {
269269
console.clear(); // eslint-disable-line no-console
270+
dispatch({ type: 'clear-console' });
270271
}
271272

272273
// Do it here so we can see the dependency fetching screen if needed

src/app/store/preferences/reducer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const initialState: Preferences = Object.keys(keys).reduce(
4141
fontSize: 14,
4242
fontFamily: '',
4343
lineHeight: 1.15,
44-
clearConsoleEnabled: false,
44+
clearConsoleEnabled: true,
4545
prettierConfig: DEFAULT_PRETTIER_CONFIG,
4646
codeMirror: false,
4747
autoDownloadTypes: true,

0 commit comments

Comments
 (0)