Skip to content

Commit cddb1ea

Browse files
committed
refactor: remove unused showScreen prop
1 parent 07a5e0d commit cddb1ea

3 files changed

Lines changed: 4 additions & 6 deletions

File tree

src/livecodes/core.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4966,7 +4966,6 @@ const basicHandlers = () => {
49664966
getConfig,
49674967
showEditor,
49684968
run,
4969-
showScreen,
49704969
toolsPane,
49714970
split,
49724971
isEmbed,

src/livecodes/handlers/__tests__/keyboard-shortcuts.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ describe('Keyboard Shortcuts Handler', () => {
8484
getConfig: jest.fn().mockReturnValue(mockConfig),
8585
showEditor: jest.fn(),
8686
run: jest.fn(),
87-
showScreen: jest.fn(),
8887
toolsPane: mockToolsPane,
8988
split: mockSplit,
9089
isEmbed: false,

src/livecodes/handlers/keyboard-shortcuts.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import type { createSplitPanes } from '../UI';
12
import * as UI from '../UI/selectors';
23
import type { CodeEditor, Config, EditorId, EventsManager, ToolsPane } from '../models';
34
import { ctrl } from '../utils';
@@ -11,9 +12,8 @@ export interface KeyboardShortcutDeps {
1112
getConfig: () => Config;
1213
showEditor: (editorId: EditorId) => void;
1314
run: () => Promise<void>;
14-
showScreen: any;
1515
toolsPane?: ToolsPane;
16-
split?: any;
16+
split?: ReturnType<typeof createSplitPanes>;
1717
isEmbed: boolean;
1818
}
1919

@@ -32,7 +32,7 @@ const createCommandPaletteHandler = (deps: KeyboardShortcutDeps) => (e: Keyboard
3232

3333
const createPreventBookmarkHandler = () => (e: KeyboardEvent) => {
3434
if (ctrl(e) && e.code === 'KeyD') {
35-
e.preventDefault?.();
35+
e.preventDefault();
3636
return true;
3737
}
3838
return false;
@@ -227,7 +227,7 @@ const createFocusModeHandler = (deps: KeyboardShortcutDeps) => (e: KeyboardEvent
227227
export const setupKeyboardShortcuts = (deps: KeyboardShortcutDeps): void => {
228228
let lastkeys = '';
229229

230-
const hotKeys = async (e: KeyboardEvent) => {
230+
const hotKeys = (e: KeyboardEvent) => {
231231
// Command palette handler
232232
if (createCommandPaletteHandler(deps)(e)) {
233233
lastkeys = 'Ctrl + P';

0 commit comments

Comments
 (0)