diff --git a/package-lock.json b/package-lock.json index 260898bbd..849d60b70 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "Casper Wallet", - "version": "1.11.1", + "version": "1.12.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "Casper Wallet", - "version": "1.11.1", + "version": "1.12.0", "dependencies": { "@formatjs/intl": "2.10.4", "@hookform/resolvers": "2.9.10", diff --git a/package.json b/package.json index 2bdd96d95..41481d3a0 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "Casper Wallet", "description": "Securely manage your CSPR tokens and interact with dapps with the self-custody wallet for the Casper blockchain.", - "version": "1.11.1", + "version": "1.12.0", "author": "MAKE LLC", "scripts": { "devtools:redux": "redux-devtools --hostname=localhost", diff --git a/scripts/build_all.sh b/scripts/build_all.sh index cf122d7fa..c9c8dd558 100755 --- a/scripts/build_all.sh +++ b/scripts/build_all.sh @@ -1,3 +1,3 @@ HASH=$(git rev-parse --short HEAD) -npm run build:chrome && npm run build:firefox && cd ./build && zip -r casper-wallet-1.11.1#$HASH.zip ./* && npm run build:src +npm run build:chrome && npm run build:firefox && cd ./build && zip -r casper-wallet-1.12.0#$HASH.zip ./* && npm run build:src diff --git a/src/apps/onboarding/pages/unlock-wallet/index.tsx b/src/apps/onboarding/pages/unlock-wallet/index.tsx index c33c9b27f..f8c3a3983 100644 --- a/src/apps/onboarding/pages/unlock-wallet/index.tsx +++ b/src/apps/onboarding/pages/unlock-wallet/index.tsx @@ -3,6 +3,8 @@ import { Trans, useTranslation } from 'react-i18next'; import { useSelector } from 'react-redux'; import styled from 'styled-components'; +import { PasswordDoesNotExistError } from '@src/errors'; + import { UnlockWalletPageContent } from '@onboarding/pages/unlock-wallet/content'; import { RouterPath, useTypedNavigate } from '@onboarding/router'; @@ -39,7 +41,7 @@ export function UnlockWalletPage({ saveIsLoggedIn }: UnlockWalletPageProps) { const passwordSaltHash = useSelector(selectPasswordSaltHash); if (passwordHash == null || passwordSaltHash == null) { - throw Error("Password doesn't exist"); + throw new PasswordDoesNotExistError(); } const { diff --git a/src/apps/popup/pages/navigation-menu/index.tsx b/src/apps/popup/pages/navigation-menu/index.tsx index e516896aa..7d981c3ad 100644 --- a/src/apps/popup/pages/navigation-menu/index.tsx +++ b/src/apps/popup/pages/navigation-menu/index.tsx @@ -184,17 +184,17 @@ export function NavigationMenuPageContent() { } } ] - : []), - { - id: 6, - title: t('Add watch account'), - iconPath: 'assets/icons/plus.svg', - disabled: false, - handleOnClick: () => { - closeNavigationMenu(); - navigate(RouterPath.AddWatchAccount); - } - } + : []) + // { + // id: 6, + // title: t('Add watch account'), + // iconPath: 'assets/icons/plus.svg', + // disabled: false, + // handleOnClick: () => { + // closeNavigationMenu(); + // navigate(RouterPath.AddWatchAccount); + // } + // } ] }, { diff --git a/src/apps/popup/pages/password-protection-page/index.tsx b/src/apps/popup/pages/password-protection-page/index.tsx index e6d2769e9..c2dad1b54 100644 --- a/src/apps/popup/pages/password-protection-page/index.tsx +++ b/src/apps/popup/pages/password-protection-page/index.tsx @@ -9,6 +9,7 @@ import { ERROR_DISPLAYED_BEFORE_ATTEMPT_IS_DECREMENTED, LOGIN_RETRY_ATTEMPTS_LIMIT } from '@src/constants'; +import { PasswordDoesNotExistError } from '@src/errors'; import { getErrorMessageForIncorrectPassword } from '@src/utils'; import { @@ -66,7 +67,7 @@ export const PasswordProtectionPage = ({ ERROR_DISPLAYED_BEFORE_ATTEMPT_IS_DECREMENTED; if (passwordHash == null || passwordSaltHash == null) { - throw Error("Password doesn't exist"); + throw new PasswordDoesNotExistError(); } const { diff --git a/src/errors.ts b/src/errors.ts new file mode 100644 index 000000000..3f9f3b7e4 --- /dev/null +++ b/src/errors.ts @@ -0,0 +1,5 @@ +export class PasswordDoesNotExistError extends Error { + constructor() { + super("Password doesn't exist"); + } +} diff --git a/src/libs/layout/error/error-boundary.tsx b/src/libs/layout/error/error-boundary.tsx index 969e354e3..27a6163e5 100644 --- a/src/libs/layout/error/error-boundary.tsx +++ b/src/libs/layout/error/error-boundary.tsx @@ -1,5 +1,7 @@ import React, { Component, ReactNode } from 'react'; +import { PasswordDoesNotExistError } from '@src/errors'; + import { WindowErrorPage, createErrorLocationState } from '@libs/layout'; interface Props { @@ -32,12 +34,16 @@ export class ErrorBoundary extends Component { // TODO: Add localizations below return ( diff --git a/src/libs/layout/error/window-page.tsx b/src/libs/layout/error/window-page.tsx index 606c697be..40354490c 100644 --- a/src/libs/layout/error/window-page.tsx +++ b/src/libs/layout/error/window-page.tsx @@ -1,7 +1,12 @@ import React from 'react'; import { NavigateFunction } from 'react-router'; +import { PasswordDoesNotExistError } from '@src/errors'; + import { closeCurrentWindow } from '@background/close-current-window'; +import { openOnboardingUi } from '@background/open-onboarding-flow'; +import { resetVault } from '@background/redux/sagas/actions'; +import { dispatchToMainStore } from '@background/redux/utils'; import { FooterButtonsContainer, @@ -17,12 +22,14 @@ interface ErrorPageProps { overrideState?: { state: Required }; createTypedNavigate?: () => NavigateFunction; createTypedLocation?: () => Location & any; + error?: Error | null; } export function WindowErrorPage({ overrideState, createTypedNavigate, - createTypedLocation + createTypedLocation, + error }: ErrorPageProps) { const navigate = createTypedNavigate ? createTypedNavigate() @@ -50,11 +57,20 @@ export function WindowErrorPage({ diff --git a/src/libs/layout/unlock-vault/index.tsx b/src/libs/layout/unlock-vault/index.tsx index afd1d6491..c2dbcc5cd 100644 --- a/src/libs/layout/unlock-vault/index.tsx +++ b/src/libs/layout/unlock-vault/index.tsx @@ -11,6 +11,7 @@ import { ERROR_DISPLAYED_BEFORE_ATTEMPT_IS_DECREMENTED, LOGIN_RETRY_ATTEMPTS_LIMIT } from '@src/constants'; +import { PasswordDoesNotExistError } from '@src/errors'; import { getErrorMessageForIncorrectPassword } from '@src/utils'; import { @@ -79,7 +80,7 @@ export const UnlockVaultPage = ({ popupLayout }: UnlockVaultPageProps) => { ERROR_DISPLAYED_BEFORE_ATTEMPT_IS_DECREMENTED; if (passwordHash == null || passwordSaltHash == null) { - throw Error("Password doesn't exist"); + throw new PasswordDoesNotExistError(); } const { diff --git a/xcode-project/Casper Wallet/Casper Wallet.xcodeproj/project.pbxproj b/xcode-project/Casper Wallet/Casper Wallet.xcodeproj/project.pbxproj index 271a10e36..2375a0527 100644 --- a/xcode-project/Casper Wallet/Casper Wallet.xcodeproj/project.pbxproj +++ b/xcode-project/Casper Wallet/Casper Wallet.xcodeproj/project.pbxproj @@ -38,13 +38,13 @@ 2439D7D429F0757C00F07C90 /* onboarding.html in Resources */ = {isa = PBXBuildFile; fileRef = 2439D7BE29F0757C00F07C90 /* onboarding.html */; }; 2439D7D529F0757C00F07C90 /* signature-request.html in Resources */ = {isa = PBXBuildFile; fileRef = 2439D7BF29F0757C00F07C90 /* signature-request.html */; }; B3867CAE2A7B038000BD01B7 /* declarative_net_request_rules.json in Resources */ = {isa = PBXBuildFile; fileRef = B3867CAC2A7B038000BD01B7 /* declarative_net_request_rules.json */; }; - B3C8A9332C21AF6D006B8DA3 /* 314.bundle.js in Resources */ = {isa = PBXBuildFile; fileRef = B3C8A92C2C21AF6C006B8DA3 /* 314.bundle.js */; }; - B3C8A9342C21AF6D006B8DA3 /* 355.bundle.js in Resources */ = {isa = PBXBuildFile; fileRef = B3C8A92D2C21AF6C006B8DA3 /* 355.bundle.js */; }; - B3C8A9352C21AF6D006B8DA3 /* 83.bundle.js in Resources */ = {isa = PBXBuildFile; fileRef = B3C8A92E2C21AF6C006B8DA3 /* 83.bundle.js */; }; - B3C8A9362C21AF6D006B8DA3 /* 176.bundle.js in Resources */ = {isa = PBXBuildFile; fileRef = B3C8A92F2C21AF6C006B8DA3 /* 176.bundle.js */; }; - B3C8A9372C21AF6D006B8DA3 /* 878.bundle.js in Resources */ = {isa = PBXBuildFile; fileRef = B3C8A9302C21AF6C006B8DA3 /* 878.bundle.js */; }; - B3C8A9382C21AF6D006B8DA3 /* 564.bundle.js in Resources */ = {isa = PBXBuildFile; fileRef = B3C8A9312C21AF6C006B8DA3 /* 564.bundle.js */; }; - B3C8A9392C21AF6D006B8DA3 /* 467.bundle.js in Resources */ = {isa = PBXBuildFile; fileRef = B3C8A9322C21AF6C006B8DA3 /* 467.bundle.js */; }; + B39F2C712C885940002CF2B9 /* 646.bundle.js in Resources */ = {isa = PBXBuildFile; fileRef = B39F2C6A2C885940002CF2B9 /* 646.bundle.js */; }; + B39F2C722C885940002CF2B9 /* 652.bundle.js in Resources */ = {isa = PBXBuildFile; fileRef = B39F2C6B2C885940002CF2B9 /* 652.bundle.js */; }; + B39F2C732C885940002CF2B9 /* 271.bundle.js in Resources */ = {isa = PBXBuildFile; fileRef = B39F2C6C2C885940002CF2B9 /* 271.bundle.js */; }; + B39F2C742C885940002CF2B9 /* 812.bundle.js in Resources */ = {isa = PBXBuildFile; fileRef = B39F2C6D2C885940002CF2B9 /* 812.bundle.js */; }; + B39F2C752C885940002CF2B9 /* 209.bundle.js in Resources */ = {isa = PBXBuildFile; fileRef = B39F2C6E2C885940002CF2B9 /* 209.bundle.js */; }; + B39F2C762C885940002CF2B9 /* 63.bundle.js in Resources */ = {isa = PBXBuildFile; fileRef = B39F2C6F2C885940002CF2B9 /* 63.bundle.js */; }; + B39F2C772C885940002CF2B9 /* 36.bundle.js in Resources */ = {isa = PBXBuildFile; fileRef = B39F2C702C885940002CF2B9 /* 36.bundle.js */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -109,13 +109,13 @@ 2439D7BE29F0757C00F07C90 /* onboarding.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; name = onboarding.html; path = ../../../build/firefox/onboarding.html; sourceTree = ""; }; 2439D7BF29F0757C00F07C90 /* signature-request.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; name = "signature-request.html"; path = "../../../build/firefox/signature-request.html"; sourceTree = ""; }; B3867CAC2A7B038000BD01B7 /* declarative_net_request_rules.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = declarative_net_request_rules.json; path = ../../../src/declarative_net_request_rules.json; sourceTree = ""; }; - B3C8A92C2C21AF6C006B8DA3 /* 314.bundle.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = 314.bundle.js; path = ../../../build/firefox/314.bundle.js; sourceTree = ""; }; - B3C8A92D2C21AF6C006B8DA3 /* 355.bundle.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = 355.bundle.js; path = ../../../build/firefox/355.bundle.js; sourceTree = ""; }; - B3C8A92E2C21AF6C006B8DA3 /* 83.bundle.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = 83.bundle.js; path = ../../../build/firefox/83.bundle.js; sourceTree = ""; }; - B3C8A92F2C21AF6C006B8DA3 /* 176.bundle.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = 176.bundle.js; path = ../../../build/firefox/176.bundle.js; sourceTree = ""; }; - B3C8A9302C21AF6C006B8DA3 /* 878.bundle.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = 878.bundle.js; path = ../../../build/firefox/878.bundle.js; sourceTree = ""; }; - B3C8A9312C21AF6C006B8DA3 /* 564.bundle.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = 564.bundle.js; path = ../../../build/firefox/564.bundle.js; sourceTree = ""; }; - B3C8A9322C21AF6C006B8DA3 /* 467.bundle.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = 467.bundle.js; path = ../../../build/firefox/467.bundle.js; sourceTree = ""; }; + B39F2C6A2C885940002CF2B9 /* 646.bundle.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = 646.bundle.js; path = ../../../build/firefox/646.bundle.js; sourceTree = ""; }; + B39F2C6B2C885940002CF2B9 /* 652.bundle.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = 652.bundle.js; path = ../../../build/firefox/652.bundle.js; sourceTree = ""; }; + B39F2C6C2C885940002CF2B9 /* 271.bundle.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = 271.bundle.js; path = ../../../build/firefox/271.bundle.js; sourceTree = ""; }; + B39F2C6D2C885940002CF2B9 /* 812.bundle.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = 812.bundle.js; path = ../../../build/firefox/812.bundle.js; sourceTree = ""; }; + B39F2C6E2C885940002CF2B9 /* 209.bundle.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = 209.bundle.js; path = ../../../build/firefox/209.bundle.js; sourceTree = ""; }; + B39F2C6F2C885940002CF2B9 /* 63.bundle.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = 63.bundle.js; path = ../../../build/firefox/63.bundle.js; sourceTree = ""; }; + B39F2C702C885940002CF2B9 /* 36.bundle.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = 36.bundle.js; path = ../../../build/firefox/36.bundle.js; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -194,13 +194,13 @@ 2439D7A929F0757C00F07C90 /* Resources */ = { isa = PBXGroup; children = ( - B3C8A92E2C21AF6C006B8DA3 /* 83.bundle.js */, - B3C8A92F2C21AF6C006B8DA3 /* 176.bundle.js */, - B3C8A92C2C21AF6C006B8DA3 /* 314.bundle.js */, - B3C8A92D2C21AF6C006B8DA3 /* 355.bundle.js */, - B3C8A9322C21AF6C006B8DA3 /* 467.bundle.js */, - B3C8A9312C21AF6C006B8DA3 /* 564.bundle.js */, - B3C8A9302C21AF6C006B8DA3 /* 878.bundle.js */, + B39F2C702C885940002CF2B9 /* 36.bundle.js */, + B39F2C6F2C885940002CF2B9 /* 63.bundle.js */, + B39F2C6E2C885940002CF2B9 /* 209.bundle.js */, + B39F2C6C2C885940002CF2B9 /* 271.bundle.js */, + B39F2C6A2C885940002CF2B9 /* 646.bundle.js */, + B39F2C6B2C885940002CF2B9 /* 652.bundle.js */, + B39F2C6D2C885940002CF2B9 /* 812.bundle.js */, B3867CAC2A7B038000BD01B7 /* declarative_net_request_rules.json */, 2439D7AA29F0757C00F07C90 /* connectToApp.bundle.js */, 2439D7AB29F0757C00F07C90 /* logo16.png */, @@ -321,34 +321,34 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + B39F2C772C885940002CF2B9 /* 36.bundle.js in Resources */, 2439D7D429F0757C00F07C90 /* onboarding.html in Resources */, + B39F2C752C885940002CF2B9 /* 209.bundle.js in Resources */, 2439D7CB29F0757C00F07C90 /* logo64.png in Resources */, + B39F2C732C885940002CF2B9 /* 271.bundle.js in Resources */, 2439D7D229F0757C00F07C90 /* popup.bundle.js in Resources */, + B39F2C742C885940002CF2B9 /* 812.bundle.js in Resources */, 2439D7C029F0757C00F07C90 /* connectToApp.bundle.js in Resources */, + B39F2C762C885940002CF2B9 /* 63.bundle.js in Resources */, 2439D7D129F0757C00F07C90 /* assets in Resources */, 2439D7C129F0757C00F07C90 /* logo16.png in Resources */, 2439D7C729F0757C00F07C90 /* contentScript.bundle.js in Resources */, 2439D7D329F0757C00F07C90 /* logo192.png in Resources */, 2439D7C429F0757C00F07C90 /* locales in Resources */, 2439D7D029F0757C00F07C90 /* onboarding.bundle.js in Resources */, - B3C8A9352C21AF6D006B8DA3 /* 83.bundle.js in Resources */, - B3C8A9342C21AF6D006B8DA3 /* 355.bundle.js in Resources */, 2439D7C829F0757C00F07C90 /* popup.html in Resources */, 2439D7C929F0757C00F07C90 /* background.bundle.js in Resources */, + B39F2C722C885940002CF2B9 /* 652.bundle.js in Resources */, + B39F2C712C885940002CF2B9 /* 646.bundle.js in Resources */, 2439D7C529F0757C00F07C90 /* import-account-with-file.html in Resources */, 2439D7C629F0757C00F07C90 /* sdk.bundle.js in Resources */, 2439D7CD29F0757C00F07C90 /* importAccountWithFile.bundle.js in Resources */, - B3C8A9392C21AF6D006B8DA3 /* 467.bundle.js in Resources */, - B3C8A9362C21AF6D006B8DA3 /* 176.bundle.js in Resources */, 2439D7CF29F0757C00F07C90 /* manifest.json in Resources */, - B3C8A9332C21AF6D006B8DA3 /* 314.bundle.js in Resources */, 2439D7CC29F0757C00F07C90 /* signatureRequest.bundle.js in Resources */, B3867CAE2A7B038000BD01B7 /* declarative_net_request_rules.json in Resources */, - B3C8A9382C21AF6D006B8DA3 /* 564.bundle.js in Resources */, 2439D7CA29F0757C00F07C90 /* logo128.png in Resources */, 2439D7C229F0757C00F07C90 /* connect-to-app.html in Resources */, 2439D7D529F0757C00F07C90 /* signature-request.html in Resources */, - B3C8A9372C21AF6D006B8DA3 /* 878.bundle.js in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -584,7 +584,7 @@ CODE_SIGN_ENTITLEMENTS = "Casper Wallet/Casper Wallet.entitlements"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 70; + CURRENT_PROJECT_VERSION = 79; ENABLE_HARDENED_RUNTIME = YES; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = "Casper Wallet/Info.plist"; @@ -598,7 +598,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.14; - MARKETING_VERSION = 1.11.1; + MARKETING_VERSION = 1.12.0; OTHER_LDFLAGS = ( "-framework", SafariServices, @@ -621,7 +621,7 @@ CODE_SIGN_ENTITLEMENTS = "Casper Wallet/Casper Wallet.entitlements"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 70; + CURRENT_PROJECT_VERSION = 79; ENABLE_HARDENED_RUNTIME = YES; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = "Casper Wallet/Info.plist"; @@ -635,7 +635,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.14; - MARKETING_VERSION = 1.11.1; + MARKETING_VERSION = 1.12.0; OTHER_LDFLAGS = ( "-framework", SafariServices,