From b775ae7810b9be39411a5561ea6ab6e07f11d6a1 Mon Sep 17 00:00:00 2001 From: caorushizi <84996057@qq.com> Date: Sat, 17 Apr 2021 18:24:49 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=20ts=20=E6=94=AF?= =?UTF-8?q?=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- renderer/browser-window/main.tsx | 6 ++++-- renderer/confirm-window/App.tsx | 4 ++-- renderer/main-window/App.tsx | 1 - 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/renderer/browser-window/main.tsx b/renderer/browser-window/main.tsx index cbdb21e..038e131 100644 --- a/renderer/browser-window/main.tsx +++ b/renderer/browser-window/main.tsx @@ -49,7 +49,7 @@ interface State { } class App extends React.Component { - view?: Electron.BrowserView; + view: Electron.BrowserView | null; resizeObserver?: ResizeObserver; @@ -63,6 +63,8 @@ class App extends React.Component { title: "", isFav: false, }; + + this.view = null; } async componentDidMount() { @@ -76,7 +78,7 @@ class App extends React.Component { this.view?.setBounds({ x: 0, y: 0, height: 0, width: 0 }); this.view?.webContents.off("dom-ready", this.handleViewDOMReady); ipcRenderer.removeListener("viewReady", this.handleViewReady); - this.view = undefined; + this.view = null; this.resizeObserver?.disconnect(); } diff --git a/renderer/confirm-window/App.tsx b/renderer/confirm-window/App.tsx index e788398..86144e1 100644 --- a/renderer/confirm-window/App.tsx +++ b/renderer/confirm-window/App.tsx @@ -1,4 +1,4 @@ -import React from "react"; +import React, { ReactNode } from "react"; import WindowToolBar from "renderer/common/components/WindowToolBar"; interface Props {} @@ -10,7 +10,7 @@ class SettingWindow extends React.Component { super(props); } - render() { + render(): ReactNode { return (
{}}>是否确认 diff --git a/renderer/main-window/App.tsx b/renderer/main-window/App.tsx index 47dbcad..354a86c 100644 --- a/renderer/main-window/App.tsx +++ b/renderer/main-window/App.tsx @@ -18,7 +18,6 @@ import { import { ReactNode } from "react"; import { EllipsisOutlined } from "@ant-design/icons"; import { ipcGetStore } from "./utils"; -import FeedImage from "./assets/feed.png"; const { remote,