From c49dc6d4c5bfcd6d8c291da98db61fb62e650b8e Mon Sep 17 00:00:00 2001 From: kvhnuke <10602065+kvhnuke@users.noreply.github.com> Date: Wed, 9 Oct 2024 15:17:04 -0700 Subject: [PATCH] devop: temp disable polkadot wasm --- packages/extension/package.json | 2 +- packages/extension/src/libs/utils/selective-wasm.ts | 6 ++++++ packages/extension/src/scripts/chrome/background.ts | 1 + packages/extension/src/ui/action/main.ts | 1 + packages/extension/src/ui/onboard/main.ts | 1 + packages/extension/src/ui/provider-pages/main.ts | 1 + 6 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 packages/extension/src/libs/utils/selective-wasm.ts diff --git a/packages/extension/package.json b/packages/extension/package.json index 8475b746f..235f51f3f 100644 --- a/packages/extension/package.json +++ b/packages/extension/package.json @@ -1,6 +1,6 @@ { "name": "@enkryptcom/extension", - "version": "1.44.3", + "version": "1.44.4", "private": true, "scripts": { "zip": "cd dist; zip -r release.zip *;", diff --git a/packages/extension/src/libs/utils/selective-wasm.ts b/packages/extension/src/libs/utils/selective-wasm.ts new file mode 100644 index 000000000..54aeec5d9 --- /dev/null +++ b/packages/extension/src/libs/utils/selective-wasm.ts @@ -0,0 +1,6 @@ +import { createWasm } from "@polkadot/wasm-crypto-init/asm"; +import { initBridge } from "@polkadot/wasm-crypto/init"; + +if (process.env.IS_SAFARI) { + initBridge(createWasm); +} diff --git a/packages/extension/src/scripts/chrome/background.ts b/packages/extension/src/scripts/chrome/background.ts index 97478387d..ca176c5d2 100644 --- a/packages/extension/src/scripts/chrome/background.ts +++ b/packages/extension/src/scripts/chrome/background.ts @@ -1,6 +1,7 @@ if (process.env.IS_DEV) { require("./hot-reload"); } +import "@/libs/utils/selective-wasm"; import { backgroundOnMessageFromWindow, backgroundOnMessageFromNewWindow, diff --git a/packages/extension/src/ui/action/main.ts b/packages/extension/src/ui/action/main.ts index d61da357a..c8ebbbbc2 100644 --- a/packages/extension/src/ui/action/main.ts +++ b/packages/extension/src/ui/action/main.ts @@ -3,6 +3,7 @@ import App from "./App.vue"; import router from "./router"; import * as filters from "./utils/filters"; import Vue3Lottie from "vue3-lottie"; +import "@/libs/utils/selective-wasm"; const app = createApp(App); diff --git a/packages/extension/src/ui/onboard/main.ts b/packages/extension/src/ui/onboard/main.ts index d51ebb798..46fb96db3 100644 --- a/packages/extension/src/ui/onboard/main.ts +++ b/packages/extension/src/ui/onboard/main.ts @@ -4,6 +4,7 @@ import App from "./App.vue"; import { createRouter, createWebHashHistory } from "vue-router"; import routes from "./routes"; import * as filters from "@action/utils/filters"; +import "@/libs/utils/selective-wasm"; const router = createRouter({ history: createWebHashHistory(), diff --git a/packages/extension/src/ui/provider-pages/main.ts b/packages/extension/src/ui/provider-pages/main.ts index df06f6662..64e4742bd 100644 --- a/packages/extension/src/ui/provider-pages/main.ts +++ b/packages/extension/src/ui/provider-pages/main.ts @@ -4,6 +4,7 @@ import { createRouter, createWebHashHistory } from "vue-router"; import routes from "./routes"; import * as filters from "@action/utils/filters"; import Vue3Lottie from "vue3-lottie"; +import "@/libs/utils/selective-wasm"; const router = createRouter({ history: createWebHashHistory(),