Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
blazejkustra committed Jun 25, 2024
1 parent 021e09f commit 99cffb5
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
3 changes: 2 additions & 1 deletion src/components/OfflineWithFeedback.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ function OfflineWithFeedback({
return child;
}

const childProps = child.props as {children?: React.ReactNode; style?: AllStyles};
type ChildComponentProps = ChildrenProps & {style?: AllStyles};
const childProps = child.props as ChildComponentProps;
const props: StrikethroughProps = {
style: StyleUtils.combineStyles(childProps.style ?? [], styles.offlineFeedback.deleted, styles.userSelectNone),
};
Expand Down
2 changes: 1 addition & 1 deletion src/components/Tooltip/PopoverAnchorTooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function PopoverAnchorTooltip({shouldRender = true, children, ...props}: Tooltip

const isPopoverRelatedToTooltipOpen = useMemo(() => {
// eslint-disable-next-line @typescript-eslint/dot-notation
const tooltipNode = (tooltipRef.current?.['_childNode'] as Node) ?? null;
const tooltipNode = (tooltipRef.current?.['_childNode'] as Node | undefined) ?? null;

if (
isOpen &&
Expand Down
4 changes: 2 additions & 2 deletions src/libs/Notification/PushNotification/index.native.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type {JsonValue, PushPayload} from '@ua/react-native-airship';
import type {PushPayload} from '@ua/react-native-airship';
import Airship, {EventType} from '@ua/react-native-airship';
import Onyx from 'react-native-onyx';
import Log from '@libs/Log';
Expand Down Expand Up @@ -31,7 +31,7 @@ function pushNotificationEventCallback(eventType: EventType, notification: PushP

// On Android, some notification payloads are sent as a JSON string rather than an object
if (typeof payload === 'string') {
payload = JSON.parse(payload) as JsonValue;
payload = JSON.parse(payload) as string;
}

const data = payload as PushNotificationData;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type {JsonValue, PushPayload} from '@ua/react-native-airship';
import type {PushPayload} from '@ua/react-native-airship';
import Log from '@libs/Log';
import * as ReportActionUtils from '@libs/ReportActionsUtils';
import * as Report from '@userActions/Report';
Expand All @@ -14,7 +14,7 @@ export default function shouldShowPushNotification(pushPayload: PushPayload): bo

// The payload is string encoded on Android
if (typeof payload === 'string') {
payload = JSON.parse(payload) as JsonValue;
payload = JSON.parse(payload) as string;
}

const data = payload as PushNotificationData;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type {JsonValue, PushPayload} from '@ua/react-native-airship';
import type {PushPayload} from '@ua/react-native-airship';
import Airship from '@ua/react-native-airship';
import Log from '@libs/Log';
import type {PushNotificationData} from '@libs/Notification/PushNotification/NotificationType';
Expand All @@ -8,7 +8,7 @@ import type ClearReportNotifications from './types';
const parseNotificationAndReportIDs = (pushPayload: PushPayload) => {
let payload = pushPayload.extras.payload;
if (typeof payload === 'string') {
payload = JSON.parse(payload) as JsonValue;
payload = JSON.parse(payload) as string;
}
const data = payload as PushNotificationData;
return {
Expand Down

0 comments on commit 99cffb5

Please sign in to comment.