Skip to content

Commit

Permalink
fix: fixes snap url in new dapp (#142)
Browse files Browse the repository at this point in the history
  • Loading branch information
martines3000 authored and pseudobun committed Apr 6, 2023
1 parent 82eb018 commit c7b0bfe
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
**/Dockerfile
yarn-error.log
JenkinsfileTest
.next
**/.next
install-state.gz
**/dist
**/build
Expand Down
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,7 @@ RUN pnpm install
# Copy all other files
COPY . .

ENV NODE_ENV=production

# Build affected projects
RUN pnpm build:docker
9 changes: 6 additions & 3 deletions packages/dapp/src/components/MetaMaskProvider/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ import { shallow } from 'zustand/shallow';

import { useGeneralStore, useSnapStore } from '@/utils/stores';

const snapId = 'local:http://localhost:8081';
// const snapId = 'npm:@blockchain-lab-um/ssi-snap';
const snapId =
process.env.NODE_ENV === 'production'
? 'npm:@blockchain-lab-um/ssi-snap'
: 'local:http://localhost:8081';

type MetaMaskProviderProps = {
children: React.ReactNode;
Expand Down Expand Up @@ -87,7 +89,8 @@ const MetaMaskProvider = ({ children }: MetaMaskProviderProps) => {

const enableSSISnapHandler = async () => {
const enableResult = await enableSSISnap({ snapId });

console.log(snapId);
console.log(process.env.NODE_ENV);
if (isError(enableResult)) {
console.error(enableResult.error);
changeIsConnecting(false);
Expand Down

0 comments on commit c7b0bfe

Please sign in to comment.