Skip to content

Commit

Permalink
* add ability to alter VITE port (#34)
Browse files Browse the repository at this point in the history
* dispose is async
  • Loading branch information
goweiss authored Jul 1, 2024
1 parent c6affed commit 0bd9d4c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/AppStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ export const useAppStore = create<IAppState>()((set, get) => {
}
return fireblocksNCW.deriveAssetKey(extendedPrivateKey, coinType, account, change, index);
},
disposeFireblocksNCW: () => {
disposeFireblocksNCW: async () => {
if (!fireblocksNCW) {
return;
}
Expand All @@ -574,7 +574,7 @@ export const useAppStore = create<IAppState>()((set, get) => {
txsUnsubscriber = null;
}

fireblocksNCW.dispose();
await fireblocksNCW.dispose();
fireblocksNCW = null;
set((state) => ({ ...state, fireblocksNCWStatus: "sdk_not_ready" }));
},
Expand Down
2 changes: 1 addition & 1 deletion src/IAppState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export interface IAppState {
recoverKeys: (passphraseResolver: (passphraseId: string) => Promise<string>) => Promise<void>;
backupKeys: (passhrase: string, passphraseId: string) => Promise<void>;
initFireblocksNCW: () => Promise<void>;
disposeFireblocksNCW: () => void;
disposeFireblocksNCW: () => Promise<void>;
getWeb3Connections: () => Promise<void>;
createWeb3Connection: (uri: string) => Promise<void>;
approveWeb3Connection: () => Promise<void>;
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/NewTxDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const NewTxDialog: React.FC<IProps> = ({ isOpen, onClose, assetsToSelectF
note: `API Transaction by ${deviceId}`,
accountId: "0",
assetId: assetIdPrompt,
}
};

if (txType === "transfer") {
dataToSend = {
Expand Down
28 changes: 16 additions & 12 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
import { defineConfig, splitVendorChunkPlugin } from "vite";
import { defineConfig, loadEnv, splitVendorChunkPlugin } from "vite";
import react from "@vitejs/plugin-react";

// https://vitejs.dev/config/
export default defineConfig({
base: "/ncw-web-demo/",
plugins: [react(), splitVendorChunkPlugin()],
server: {
open: true,
host: 'localhost',
hmr: true,
},
optimizeDeps: {
exclude: ["@fireblocks/ncw-js-sdk", "tsl-apple-cloudkit"],
},
export default defineConfig(({ command, mode }) => {
const env = loadEnv(mode, process.cwd());
return {
base: "/ncw-web-demo/",
plugins: [react(), splitVendorChunkPlugin()],
server: {
open: true,
host: 'localhost',
port: (env.VITE_PORT && Number(env.VITE_PORT)) || 5173,
hmr: true,
},
optimizeDeps: {
exclude: ["@fireblocks/ncw-js-sdk", "tsl-apple-cloudkit"],
},
}
});

0 comments on commit 0bd9d4c

Please sign in to comment.