Skip to content

Commit

Permalink
Merge pull request #5901 from leather-io/release/fix-get-addresses
Browse files Browse the repository at this point in the history
Release/fix get addresses
  • Loading branch information
kyranjamie authored Oct 11, 2024
2 parents 24425d1 + 8090d45 commit 1228828
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 18 deletions.
11 changes: 1 addition & 10 deletions src/app/features/feedback-button/feedback-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,10 @@ import { Box, Flex } from 'leather-styles/jsx';

import { Button, MegaphoneIcon } from '@leather.io/ui';

import { analytics, sentryFeedback } from '@shared/utils/analytics';
import { openFeedbackSheet } from '@shared/utils/analytics';

import { useThemeSwitcher } from '@app/common/theme-provider';

export async function openFeedbackSheet() {
void analytics.track('user_clicked_feedback_button');
const form = await sentryFeedback.createForm();
if (!form) return null;
form.appendToDom();
form.open();
return;
}

export function FeedbackButton() {
const { theme } = useThemeSwitcher();
return (
Expand Down
3 changes: 1 addition & 2 deletions src/app/features/settings/settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
} from '@leather.io/ui';

import { RouteUrls } from '@shared/route-urls';
import { analytics } from '@shared/utils/analytics';
import { analytics, openFeedbackSheet } from '@shared/utils/analytics';

import { useHasKeys } from '@app/common/hooks/auth/use-has-keys';
import { useKeyActions } from '@app/common/hooks/use-key-actions';
Expand All @@ -42,7 +42,6 @@ import { useCurrentNetworkId } from '@app/store/networks/networks.selectors';
import { useTogglePrivateMode } from '@app/store/settings/settings.actions';
import { useIsPrivateMode } from '@app/store/settings/settings.selectors';

import { openFeedbackSheet } from '../feedback-button/feedback-button';
import { extractDeviceNameFromKnownTargetIds } from '../ledger/utils/generic-ledger-utils';
import { AdvancedMenuItems } from './components/advanced-menu-items';
import { LedgerDeviceItemRow } from './components/ledger-item-row';
Expand Down
3 changes: 2 additions & 1 deletion src/app/pages/home/home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { useOnboardingState } from '@app/common/hooks/auth/use-onboarding-state'
import { useTotalBalance } from '@app/common/hooks/balance/use-total-balance';
import { useOnMount } from '@app/common/hooks/use-on-mount';
import { useSwitchAccountSheet } from '@app/common/switch-account/use-switch-account-sheet-context';
import { whenPageMode } from '@app/common/utils';
import { ActivityList } from '@app/features/activity-list/activity-list';
import { FeedbackButton } from '@app/features/feedback-button/feedback-button';
import { Assets } from '@app/pages/home/components/assets';
Expand Down Expand Up @@ -75,7 +76,7 @@ export function Home() {
<AccountActions />
</AccountCard>
</Box>
<FeedbackButton />
{whenPageMode({ full: <FeedbackButton />, popup: null })}
<HomeTabs>
<ModalBackgroundWrapper>
<Route index element={<Assets />} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { FaviconDisplayer } from '@app/components/favicon-displayer/favicon-disp
interface GetAddressesLayoutProps {
requester: string;
switchAccount: ReactNode;
onBeforeAnimation(): void;
onBeforeAnimation?(): void;
onUserApprovesGetAddresses(): void;
onClickRequestedByLink(): void;
}
Expand All @@ -45,7 +45,7 @@ export function GetAddressesLayout({
});

async function userApprovesGetAddresses() {
onBeforeAnimation();
onBeforeAnimation?.();
const yPos = window.innerHeight / 2 - 100;
const xPos = Math.min(window.innerWidth / 2, 320) - 84;
await contentDisappears.start({
Expand Down
1 change: 0 additions & 1 deletion src/app/pages/rpc-get-addresses/rpc-get-addresses.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ export function RpcGetAddresses() {
return (
<GetAddressesLayout
requester={origin}
onBeforeAnimation={focusInitatingTab}
onClickRequestedByLink={focusInitatingTab}
switchAccount={
<AccountListItemLayout
Expand Down
16 changes: 14 additions & 2 deletions src/shared/utils/analytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export async function identifyUser(publicKey: Uint8Array) {
return analytics.identify(deriveAnalyticsIdentifier(publicKey));
}

export const sentryFeedback = feedbackIntegration({
const sentryFeedback = feedbackIntegration({
colorScheme: 'system',
isEmailRequired: false,
buttonLabel: 'Give feedback',
Expand All @@ -78,7 +78,8 @@ export const sentryFeedback = feedbackIntegration({
showEmail: false,
showName: false,
showBranding: false,
messageLabel: 'Feedback',
messageLabel: 'How can we improve Leather?',
enableScreenshot: false,
submitButtonLabel: 'Send feedback',
messagePlaceholder:
'This is not a support tool. To get help, follow the link in the main menu on the homepage.',
Expand Down Expand Up @@ -139,4 +140,15 @@ export function initSentry() {
return event;
},
});

Sentry.setTag('app_version', VERSION);
}

export async function openFeedbackSheet() {
void analytics.track('user_clicked_feedback_button');
const form = await sentryFeedback.createForm();
if (!form) return null;
form.appendToDom();
form.open();
return;
}

0 comments on commit 1228828

Please sign in to comment.