Skip to content

Commit

Permalink
Merge branch 'main' into fix/lw-11936-jpeg-store-sell-tx-displayed-as…
Browse files Browse the repository at this point in the history
…-negative
  • Loading branch information
mirceahasegan authored Jan 15, 2025
2 parents 73cead0 + 278d413 commit 4dc636a
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 9 deletions.
5 changes: 3 additions & 2 deletions apps/browser-extension-wallet/src/dapp-connector.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable unicorn/no-nested-ternary */
import * as React from 'react';
import { render } from 'react-dom';
import { DappConnectorView } from '@routes';
Expand All @@ -21,7 +22,7 @@ import { storage } from 'webextension-polyfill';
import { TxWitnessRequestProvider } from '@providers/TxWitnessRequestProvider';

const App = (): React.ReactElement => {
const [mode, setMode] = useState<'lace' | 'nami'>();
const [mode, setMode] = useState<'lace' | 'nami' | undefined>();

storage.onChanged.addListener((changes) => {
const oldModeValue = changes.BACKGROUND_STORAGE?.oldValue?.namiMigration;
Expand Down Expand Up @@ -58,7 +59,7 @@ const App = (): React.ReactElement => {
<AddressesDiscoveryOverlay>
<UIThemeProvider>
<TxWitnessRequestProvider>
{mode === 'nami' ? <NamiDappConnector /> : <DappConnectorView />}
{!mode ? <></> : mode === 'nami' ? <NamiDappConnector /> : <DappConnectorView />}
</TxWitnessRequestProvider>
</UIThemeProvider>
</AddressesDiscoveryOverlay>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
}

.footer {
background-color: var(--bg-color-white);
background-color: var(--light-mode-body, var(--dark-mode-bg-black));
@extend %flex-column;
justify-content: center;
gap: size_unit(1);
Expand Down
10 changes: 10 additions & 0 deletions apps/browser-extension-wallet/src/routes/DappConnectorView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import { DappSignDataSuccess } from '@src/features/dapp/components/DappSignDataS
import { DappSignDataFail } from '@src/features/dapp/components/DappSignDataFail';
import { Crash } from '@components/Crash';
import { useFatalError } from '@hooks/useFatalError';
import { POPUP_WINDOW } from '@src/utils/constants';

dayjs.extend(duration);

Expand Down Expand Up @@ -58,6 +59,15 @@ export const DappConnectorView = (): React.ReactElement => {
load();
}, [isWalletLocked, cardanoWallet]);

useEffect(() => {
// Windows is somehow not opening the popup with the right size. Dynamically changing it, fixes it for now:
if (navigator.userAgent.includes('Win')) {
const width = POPUP_WINDOW.width + (window.outerWidth - window.innerWidth);
const height = POPUP_WINDOW.height + (window.outerHeight - window.innerHeight);
window.resizeTo(width, height);
}
}, []);

const isLoading = useMemo(() => hdDiscoveryStatus !== 'Idle', [hdDiscoveryStatus]);
const fatalError = useFatalError();
useEffect(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export const RestoreWalletProvider = ({ children }: Props): React.ReactElement =
const finalizeWalletRestoration = useCallback(
async (params: Partial<CreateWalletParams>) => {
const { source, wallet } = await createWallet(params);
void sendPostWalletAddAnalytics({
await sendPostWalletAddAnalytics({
extendedAccountPublicKey: source.account.extendedAccountPublicKey,
postHogActionHdWallet: postHogActions.restore.HD_WALLET,
postHogActionWalletAdded: postHogActions.restore.WALLET_ADDED,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ export const useHotWalletCreation = ({ initialMnemonic }: UseSoftwareWalletCreat
})();
}, [createWalletData.name, walletManager.walletRepository, setCreateWalletData]);

const createWallet = (newData: Partial<CreateWalletParams>) =>
walletManager.createWallet({
const createWallet = async (newData: Partial<CreateWalletParams>) =>
await walletManager.createWallet({
...createWalletData,
...newData
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ Feature: Analytics - Posthog - Onboarding - Extended View
And I validate latest analytics single event "onboarding | restore wallet revamp | enter your recovery phrase | next | click"
When I enter wallet name: "ValidName", password: "N_8J@bne87A" and password confirmation: "N_8J@bne87A"
And I click "Enter wallet" button
Then I validate latest analytics single event "onboarding | restore wallet revamp | let's set up your new wallet | enter wallet | click"
# And "$create_alias" PostHog event was sent // TODO: uncomment when LW-12025 is fixed
# And I validate that alias event has assigned same user id "5b3ca1f1f7a14aad1e79f46213e2777d" in posthog
Then I validate latest analytics single event "onboarding | restore wallet revamp | added"
And "$create_alias" PostHog event was sent
And I validate that alias event has assigned same user id "9646a33207b90ae60ae83770aaa82597" in posthog

@LW-7365
Scenario: Analytics - Onboarding new wallet events
Expand Down

0 comments on commit 4dc636a

Please sign in to comment.