mirror of
https://github.com/usememos/memos.git
synced 2025-02-12 09:20:42 +01:00
fix: update initial wasm
This commit is contained in:
parent
554f93eccc
commit
e3afad74ce
@ -26,11 +26,6 @@ const App = () => {
|
||||
}, [systemStatus.host]);
|
||||
|
||||
useEffect(() => {
|
||||
const initialGoWASMExec = async () => {
|
||||
const go = new window.Go();
|
||||
const result = await WebAssembly.instantiateStreaming(fetch("/gomark.wasm"), go.importObject);
|
||||
go.run(result.instance);
|
||||
};
|
||||
const initialState = async () => {
|
||||
try {
|
||||
await userStore.fetchCurrentUser();
|
||||
@ -39,7 +34,7 @@ const App = () => {
|
||||
}
|
||||
};
|
||||
|
||||
Promise.all([initialGoWASMExec(), initialState()]).then(() => setLoading(false));
|
||||
Promise.all([initialState()]).then(() => setLoading(false));
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
|
@ -5,6 +5,7 @@ import { Provider } from "react-redux";
|
||||
import { RouterProvider } from "react-router-dom";
|
||||
import "./css/global.css";
|
||||
import "./css/tailwind.css";
|
||||
import wasmUrl from "./gomark.wasm?url";
|
||||
import "./helpers/polyfill";
|
||||
import "./i18n";
|
||||
import "./less/highlight.less";
|
||||
@ -12,13 +13,20 @@ import router from "./router";
|
||||
import store from "./store";
|
||||
import theme from "./theme";
|
||||
|
||||
const container = document.getElementById("root");
|
||||
const root = createRoot(container as HTMLElement);
|
||||
root.render(
|
||||
<Provider store={store}>
|
||||
<CssVarsProvider theme={theme}>
|
||||
<RouterProvider router={router} />
|
||||
<Toaster position="top-right" />
|
||||
</CssVarsProvider>
|
||||
</Provider>,
|
||||
);
|
||||
(async () => {
|
||||
const go = new window.Go();
|
||||
const responsePromise = fetch(wasmUrl);
|
||||
const { instance } = await WebAssembly.instantiateStreaming(responsePromise, go.importObject);
|
||||
go.run(instance);
|
||||
|
||||
const container = document.getElementById("root");
|
||||
const root = createRoot(container as HTMLElement);
|
||||
root.render(
|
||||
<Provider store={store}>
|
||||
<CssVarsProvider theme={theme}>
|
||||
<RouterProvider router={router} />
|
||||
<Toaster position="top-right" />
|
||||
</CssVarsProvider>
|
||||
</Provider>,
|
||||
);
|
||||
})();
|
||||
|
Loading…
x
Reference in New Issue
Block a user