Skip to content

Commit

Permalink
fix: fix wallet setup kick-off automatically in the Reset Wallet flow (
Browse files Browse the repository at this point in the history
…#863)

* fixed issue with auto launching onboarding after wallet reset

* fixed prettier issues

---------

Co-authored-by: ost-ptk <[email protected]>
  • Loading branch information
ost-ptk and ost-ptk authored Nov 27, 2023
1 parent 95e6899 commit e2dde80
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 15 deletions.
4 changes: 2 additions & 2 deletions src/apps/popup/pages/stakes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -414,8 +414,8 @@ export const StakesPage = () => {
{stakeStep === StakeSteps.Confirm
? getConfirmButtonText()
: stakeStep === StakeSteps.Success
? 'Done'
: 'Next'}
? 'Done'
: 'Next'}
</Trans>
</Button>
</FooterButtonsContainer>
Expand Down
4 changes: 2 additions & 2 deletions src/apps/popup/pages/transfer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -437,8 +437,8 @@ export const TransferPage = () => {
{transferStep === TransactionSteps.Confirm
? 'Send'
: transferStep === TransactionSteps.Success
? 'Done'
: 'Next'}
? 'Done'
: 'Next'}
</Trans>
</Button>
</FooterButtonsContainer>
Expand Down
7 changes: 6 additions & 1 deletion src/background/close-window-by-reload-extension.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import browser from 'webextension-polyfill';

import { isSafariBuild } from '@src/utils';
import { isFirefoxBuild, isSafariBuild } from '@src/utils';

// It's hacky for Safari browser => browser.runtime.reload();
// window.close() method can only be called on windows that were opened by a script using the Window.open() method.
Expand All @@ -9,6 +9,11 @@ import { isSafariBuild } from '@src/utils';
// WARNING: IT WILL RELOAD ENTIRE EXTENSION
export function closeWindowByReloadExtension() {
if (isSafariBuild) {
browser.tabs.create({ url: 'onboarding.html', active: true });
browser.runtime.reload();
return;
}
if (isFirefoxBuild) {
browser.runtime.reload();
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ export const useMapAccountDeploysListWithPendingTransactions = (
accountDeploys != null
? [...filteredTransactions, ...accountDeploys]
: mappedPendingTransactions.length > 0
? mappedPendingTransactions
: null;
? mappedPendingTransactions
: null;

return {
accountDeploysListWithPendingTransactions
Expand Down
4 changes: 2 additions & 2 deletions src/libs/ui/components/avatar/avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ export const Avatar = ({
? 'assets/icons/connected-dark.svg'
: 'assets/icons/connected-dark-big.svg'
: displayContext === 'header'
? 'assets/icons/connected-light.svg'
: 'assets/icons/connected-light-big.svg';
? 'assets/icons/connected-light.svg'
: 'assets/icons/connected-light-big.svg';

if (withConnectedStatus && isConnected !== undefined) {
return (
Expand Down
4 changes: 2 additions & 2 deletions src/libs/ui/components/checkbox/checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ export function Checkbox({
? 'assets/icons/checkbox-square-checked.svg'
: 'assets/icons/checkbox-square.svg'
: checked
? 'assets/icons/checkbox-checked.svg'
: 'assets/icons/checkbox.svg';
? 'assets/icons/checkbox-checked.svg'
: 'assets/icons/checkbox.svg';

return (
<StyledFlexRow
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ const ConnectionStatusBadgeContainer = styled(
displayContext === 'accountList'
? null
: isConnected
? hexToRGBA(theme.color.contentPositive, '.12')
: theme.color.backgroundSecondary};
? hexToRGBA(theme.color.contentPositive, '.12')
: theme.color.backgroundSecondary};
`;

export function ConnectionStatusBadge({
Expand Down
4 changes: 2 additions & 2 deletions src/libs/ui/components/secret-phrase-words-view/word-tag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ const WordContainer = styled(FlexRow)<DisabledOrSelected & IsEmptyWord>`
disabled
? theme.color.contentSecondary
: selected
? theme.color.contentOnFill
: 'inherit'};
? theme.color.contentOnFill
: 'inherit'};
border-radius: 6px;
cursor: ${({ onClick, disabled }) =>
onClick && !disabled ? 'pointer' : 'auto'};
Expand Down
1 change: 1 addition & 0 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export const getUrlOrigin = (url: string | undefined) => {
};

export const isSafariBuild = process.env.BROWSER === Browser.Safari;
export const isFirefoxBuild = process.env.BROWSER === Browser.Firefox;

export const isValidU64 = (value?: string): boolean => {
if (!value) {
Expand Down

0 comments on commit e2dde80

Please sign in to comment.