From ad7097ea9200cd3da885c8b5763fa106876d2631 Mon Sep 17 00:00:00 2001 From: Keavon Chambers Date: Thu, 7 Jul 2022 10:58:29 -0700 Subject: [PATCH] Fix broken BigInt64Array unsupported message on old Safari --- frontend/src/App.vue | 81 +------------------------------------------- frontend/src/main.ts | 19 +++++++++++ 2 files changed, 20 insertions(+), 80 deletions(-) diff --git a/frontend/src/App.vue b/frontend/src/App.vue index c80d88b3..7423478f 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -1,20 +1,5 @@ diff --git a/frontend/src/main.ts b/frontend/src/main.ts index 3c752b96..d31c142b 100644 --- a/frontend/src/main.ts +++ b/frontend/src/main.ts @@ -4,11 +4,30 @@ import "reflect-metadata"; import { createApp } from "vue"; +import { stripIndents } from "@/utility-functions/strip-indents"; import { initWasm } from "@/wasm-communication/editor"; import App from "@/App.vue"; (async (): Promise => { + if (!("BigUint64Array" in window)) { + const body = document.body; + const message = stripIndents` + +

This browser is too old

+

Please upgrade to a modern web browser such as the latest Firefox, Chrome, Edge, or Safari version 15 or later.

+

(The BigInt64Array + JavaScript API must be supported by the browser for Graphite to function.)

+ `; + body.innerHTML = message + body.innerHTML; + return; + } + // Initialize the WASM module for the editor backend await initWasm();