Skip to content

Commit 0bd9d4c

Browse files
authored
* add ability to alter VITE port (#34)
* dispose is async
1 parent c6affed commit 0bd9d4c

File tree

4 files changed

+20
-16
lines changed

4 files changed

+20
-16
lines changed

src/AppStore.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ export const useAppStore = create<IAppState>()((set, get) => {
564564
}
565565
return fireblocksNCW.deriveAssetKey(extendedPrivateKey, coinType, account, change, index);
566566
},
567-
disposeFireblocksNCW: () => {
567+
disposeFireblocksNCW: async () => {
568568
if (!fireblocksNCW) {
569569
return;
570570
}
@@ -574,7 +574,7 @@ export const useAppStore = create<IAppState>()((set, get) => {
574574
txsUnsubscriber = null;
575575
}
576576

577-
fireblocksNCW.dispose();
577+
await fireblocksNCW.dispose();
578578
fireblocksNCW = null;
579579
set((state) => ({ ...state, fireblocksNCWStatus: "sdk_not_ready" }));
580580
},

src/IAppState.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ export interface IAppState {
105105
recoverKeys: (passphraseResolver: (passphraseId: string) => Promise<string>) => Promise<void>;
106106
backupKeys: (passhrase: string, passphraseId: string) => Promise<void>;
107107
initFireblocksNCW: () => Promise<void>;
108-
disposeFireblocksNCW: () => void;
108+
disposeFireblocksNCW: () => Promise<void>;
109109
getWeb3Connections: () => Promise<void>;
110110
createWeb3Connection: (uri: string) => Promise<void>;
111111
approveWeb3Connection: () => Promise<void>;

src/components/ui/NewTxDialog.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export const NewTxDialog: React.FC<IProps> = ({ isOpen, onClose, assetsToSelectF
3535
note: `API Transaction by ${deviceId}`,
3636
accountId: "0",
3737
assetId: assetIdPrompt,
38-
}
38+
};
3939

4040
if (txType === "transfer") {
4141
dataToSend = {

vite.config.ts

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
1-
import { defineConfig, splitVendorChunkPlugin } from "vite";
1+
import { defineConfig, loadEnv, splitVendorChunkPlugin } from "vite";
22
import react from "@vitejs/plugin-react";
33

44
// https://vitejs.dev/config/
5-
export default defineConfig({
6-
base: "/ncw-web-demo/",
7-
plugins: [react(), splitVendorChunkPlugin()],
8-
server: {
9-
open: true,
10-
host: 'localhost',
11-
hmr: true,
12-
},
13-
optimizeDeps: {
14-
exclude: ["@fireblocks/ncw-js-sdk", "tsl-apple-cloudkit"],
15-
},
5+
export default defineConfig(({ command, mode }) => {
6+
const env = loadEnv(mode, process.cwd());
7+
return {
8+
base: "/ncw-web-demo/",
9+
plugins: [react(), splitVendorChunkPlugin()],
10+
server: {
11+
open: true,
12+
host: 'localhost',
13+
port: (env.VITE_PORT && Number(env.VITE_PORT)) || 5173,
14+
hmr: true,
15+
},
16+
optimizeDeps: {
17+
exclude: ["@fireblocks/ncw-js-sdk", "tsl-apple-cloudkit"],
18+
},
19+
}
1620
});

0 commit comments

Comments
 (0)