Skip to content

Commit 428a25b

Browse files
committed
removed react-electron-web-view dependency
1 parent e446c5f commit 428a25b

File tree

4 files changed

+2
-49
lines changed

4 files changed

+2
-49
lines changed

package-lock.json

Lines changed: 0 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@
144144
"react-dnd": "^15.1.2",
145145
"react-dnd-html5-backend": "^15.1.3",
146146
"react-dom": "^18.2.0",
147-
"react-electron-web-view": "^2.0.1",
148147
"react-toastify": "^8.2.0",
149148
"react-virtualized-auto-sizer": "^1.0.6",
150149
"react-window": "^1.8.6",

packages/instrument/window/history/items/file.tsx

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ const PdfPreview = observer(
112112
}> {
113113
thumbnail: string;
114114
url: string;
115-
webView: any;
116115
zoom: boolean = false;
117116

118117
constructor(props: any) {
@@ -167,34 +166,20 @@ const PdfPreview = observer(
167166
}
168167
}
169168

170-
bringToFocus = () => {
171-
if (this.zoom && this.webView) {
172-
if (this.webView.isReady()) {
173-
this.webView.focus();
174-
} else {
175-
setTimeout(this.bringToFocus);
176-
}
177-
}
178-
};
179-
180169
componentDidMount() {
181170
this.update();
182-
this.bringToFocus();
183171
}
184172

185173
componentDidUpdate() {
186174
this.update();
187-
this.bringToFocus();
188175
}
189176

190177
render() {
191178
let content;
192179

193180
if (this.zoom) {
194-
const WebView = require("react-electron-web-view");
195181
content = this.url && (
196-
<WebView
197-
ref={(ref: any) => (this.webView = ref)}
182+
<webview
198183
src={
199184
"../../libs/pdfjs/web/viewer.html?file=" +
200185
encodeURIComponent(this.url)

packages/project-editor/store/editor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ export class EditorsStore {
212212
get tabsModel() {
213213
return (
214214
this.getLayoutModel()
215-
.getNodeById(this.tabsetID)
215+
.getNodeById(this.tabsetID)!
216216
.getChildren()[0] as FlexLayout.TabNode
217217
).getExtraData().model as FlexLayout.Model;
218218
}

0 commit comments

Comments
 (0)