Skip to content

Commit

Permalink
[ZP-UI-211] Return to Wellcome screen on api init error
Browse files Browse the repository at this point in the history
  • Loading branch information
antonpegov committed Feb 23, 2023
1 parent 3ae8690 commit d64cd32
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,18 @@ If blockchain node process halted remove it (from powershell if needed):
- netstat -ano | findstr :8545
- taskkill /PID [Process Id] /F -->

# Developement
# Developement

First of all, in the project directory create static/assets/ folder and put there respective static files from [this repo](https://github.com/zeropoolnetwork/zeropool-frontend-static.git)

Then in the project directory select the network you want to work with:

##### `mklink .env .env.near` - select NEAR (Windows command prompt as admin)

##### `ln -s .env.near .env` - select NEAR (Linux)

##### `mklink .env .env.goerli` - select Goerli (Windows command prompt as admin)

##### `ln -s .env.goerli .env` - select Goerli (Linux)

After that you can run the following commands:
Expand All @@ -40,6 +43,7 @@ You will also see any lint errors in the console.
## `yarn test:debug`

Launches the test runner in the interactive watch mode.

## `yarn test:debug [part_of_the_file_name]`

Launches the test runner in the interactive watch mode for the specified file(-s).
Expand Down
10 changes: 4 additions & 6 deletions src/wallet/components/ConfirmReset/ConfirmReset.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,15 @@ export type EditWalletProps = {
onCancel: () => void
}

export const ConfirmReset: React.FC<EditWalletProps> = ({
onReset,
onCancel,
}) => {
export const ConfirmReset: React.FC<EditWalletProps> = ({ onReset, onCancel }) => {
return (
<div className={bem()} data-testid={bem()}>
<p className={bem('Name')}>Confirm Reset</p>

<div className={bem('Text')} data-testid={bem('Text')}>
You are about to reset all your data.
If you did not save your seed, you will lose all your funds.
You are about to reset all your data related to ZeroPool that being stored in this
browser (included encripted seed phrase). If you did not save your seed somevere
else, you will lose all your funds.
</div>

<Button
Expand Down
2 changes: 2 additions & 0 deletions src/wallet/state/demo.epics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ const initApi = (action$: Action$, state$: State$) => {
toast.close('initApi')
toast.error(errMsg, { key: 'initApiError', persist: true })

setTimeout(() => window.location.reload(), 10000)

return of(demoActions.initApiFailure(errMsg))
}),
),
Expand Down
2 changes: 1 addition & 1 deletion src/wallet/state/demo.reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export const demoSlice = createSlice({
},
initApiFailure: (state, action: PayloadAction<string>) => {
state.backdrop = false
state.initials = null
state.initials = undefined
},

updateBalances: (
Expand Down
2 changes: 2 additions & 0 deletions templates/component/test.ipub
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
i = 5
print i

0 comments on commit d64cd32

Please sign in to comment.