Skip to content

Commit b40381f

Browse files
committed
fix: render method
1 parent 20cafb2 commit b40381f

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ export default class ImageTool implements BlockTool {
203203
this.isCaptionEnabled = true;
204204
}
205205

206-
return this.ui.render(this.data) as HTMLDivElement;
206+
return this.ui.render() as HTMLDivElement;
207207
}
208208

209209
/**

src/ui.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { IconPicture } from '@codexteam/icons';
22
import { make } from './utils/dom';
33
import type { API } from '@editorjs/editorjs';
4-
import type { ImageToolData, ImageConfig } from './types/types';
4+
import type { ImageConfig } from './types/types';
55

66
/**
77
* Enumeration representing the different states of the UI.
@@ -163,14 +163,9 @@ export default class Ui {
163163

164164
/**
165165
* Renders tool UI
166-
* @param toolData - saved tool data
167166
*/
168-
public render(toolData: ImageToolData): HTMLElement {
169-
if (toolData.file === undefined || Object.keys(toolData.file).length === 0) {
170-
this.toggleStatus(UiState.Empty);
171-
} else {
172-
this.toggleStatus(UiState.Empty);
173-
}
167+
public render(): HTMLElement {
168+
this.toggleStatus(UiState.Empty);
174169

175170
return this.nodes.wrapper;
176171
}

0 commit comments

Comments
 (0)