Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(000): fix lint for signature-request-siwe and metametrics #21089

Merged
merged 1 commit into from
Sep 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export default function SignatureRequestSIWE({ txData }) {
} catch (e) {
log.error(e);
}
}, []);
}, [dispatch, id]);

const handleCancelAll = () => {
const unapprovedTxCount = messagesCount;
Expand Down
1 change: 0 additions & 1 deletion ui/components/component-library/box/box.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ export type StylePropValueType =
| TextAlignArray
| TextColor
| TextColorArray
| IconColor
| IconColorArray
| undefined;

Expand Down
31 changes: 17 additions & 14 deletions ui/contexts/metametrics.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,19 +59,22 @@ export function MetaMetricsProvider({ children }) {
const context = useSegmentContext();

// Sometimes we want to track context properties inside the event's "properties" object.
const addContextPropsIntoEventProperties = (payload, options) => {
const fields = options?.contextPropsIntoEventProperties;
if (!fields || fields.length === 0) {
return;
}
if (!payload.properties) {
payload.properties = {};
}
if (fields.includes(MetaMetricsContextProp.PageTitle)) {
payload.properties[MetaMetricsContextProp.PageTitle] =
context.page?.title;
}
};
const addContextPropsIntoEventProperties = useCallback(
(payload, options) => {
const fields = options?.contextPropsIntoEventProperties;
if (!fields || fields.length === 0) {
return;
}
if (!payload.properties) {
payload.properties = {};
}
if (fields.includes(MetaMetricsContextProp.PageTitle)) {
payload.properties[MetaMetricsContextProp.PageTitle] =
context.page?.title;
}
},
[context.page?.title],
);

/**
* @type {UITrackEventMethod}
Expand All @@ -88,7 +91,7 @@ export function MetaMetricsProvider({ children }) {
options,
);
},
[context],
[addContextPropsIntoEventProperties, context],
);

// Used to prevent double tracking page calls
Expand Down
Loading