diff --git a/src/@types/global.d.ts b/src/@types/global.d.ts index a19e20b5..6a5adec6 100644 --- a/src/@types/global.d.ts +++ b/src/@types/global.d.ts @@ -14,8 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ -import {ReactNode} from "react"; import "modernizr"; +import {Renderer} from "react-dom"; declare global { interface Window { @@ -25,7 +25,10 @@ declare global { }; mxSendRageshake: (text: string, withLogs?: boolean) => void; - matrixChat: ReactNode; + matrixChat: ReturnType; + + // electron-only + ipcRenderer: any; } // workaround for https://github.com/microsoft/TypeScript/issues/30933 diff --git a/src/vector/init.ts b/src/vector/init.tsx similarity index 99% rename from src/vector/init.ts rename to src/vector/init.tsx index 85f75181..d325dbae 100644 --- a/src/vector/init.ts +++ b/src/vector/init.tsx @@ -36,7 +36,7 @@ import { initRageshake } from "./rageshakesetup"; export const rageshakePromise = initRageshake(); export function preparePlatform() { - if ((window).ipcRenderer) { + if (window.ipcRenderer) { console.log("Using Electron platform"); const plaf = new ElectronPlatform(); PlatformPeg.set(plaf);