Skip to content

Commit

Permalink
removed react-electron-web-view dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
mvladic committed Mar 2, 2023
1 parent e446c5f commit 428a25b
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 49 deletions.
31 changes: 0 additions & 31 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@
"react-dnd": "^15.1.2",
"react-dnd-html5-backend": "^15.1.3",
"react-dom": "^18.2.0",
"react-electron-web-view": "^2.0.1",
"react-toastify": "^8.2.0",
"react-virtualized-auto-sizer": "^1.0.6",
"react-window": "^1.8.6",
Expand Down
17 changes: 1 addition & 16 deletions packages/instrument/window/history/items/file.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ const PdfPreview = observer(
}> {
thumbnail: string;
url: string;
webView: any;
zoom: boolean = false;

constructor(props: any) {
Expand Down Expand Up @@ -167,34 +166,20 @@ const PdfPreview = observer(
}
}

bringToFocus = () => {
if (this.zoom && this.webView) {
if (this.webView.isReady()) {
this.webView.focus();
} else {
setTimeout(this.bringToFocus);
}
}
};

componentDidMount() {
this.update();
this.bringToFocus();
}

componentDidUpdate() {
this.update();
this.bringToFocus();
}

render() {
let content;

if (this.zoom) {
const WebView = require("react-electron-web-view");
content = this.url && (
<WebView
ref={(ref: any) => (this.webView = ref)}
<webview
src={
"../../libs/pdfjs/web/viewer.html?file=" +
encodeURIComponent(this.url)
Expand Down
2 changes: 1 addition & 1 deletion packages/project-editor/store/editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ export class EditorsStore {
get tabsModel() {
return (
this.getLayoutModel()
.getNodeById(this.tabsetID)
.getNodeById(this.tabsetID)!
.getChildren()[0] as FlexLayout.TabNode
).getExtraData().model as FlexLayout.Model;
}
Expand Down

0 comments on commit 428a25b

Please sign in to comment.