Skip to content

Commit

Permalink
🔧 Fix "New Fiddle"
Browse files Browse the repository at this point in the history
  • Loading branch information
felixrieseberg committed Aug 10, 2018
1 parent 82f83ac commit ff3fbac
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/renderer/components/editors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { EditorId } from '../../interfaces';
import { IpcEvents } from '../../ipc-events';
import { updateEditorLayout } from '../../utils/editor-layout';
import { getFocusedEditor } from '../../utils/focused-editor';
import { ContentNames, getContent } from '../content';
import { ipcRendererManager } from '../ipc';
import { AppState } from '../state';
import { mainTheme } from '../themes';
Expand Down Expand Up @@ -52,6 +53,14 @@ export class Editors extends React.Component<EditorsProps, EditorsState> {
this.executeCommand(cmd);
});

ipcRendererManager.on(IpcEvents.FS_NEW_FIDDLE, async (_event, cmd: string) => {
window.ElectronFiddle.app.setValues({
html: await getContent(ContentNames.HTML),
renderer: await getContent(ContentNames.RENDERER),
main: await getContent(ContentNames.MAIN)
});
});

this.setState({ isMounted: true });
}

Expand Down

0 comments on commit ff3fbac

Please sign in to comment.