Skip to content

Commit

Permalink
fixes after merge
Browse files Browse the repository at this point in the history
  • Loading branch information
CrisTofani committed Jan 30, 2024
1 parent 03e9bb0 commit ddc5eb5
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 9 deletions.
20 changes: 14 additions & 6 deletions ts/features/pn/components/LegacyMessageDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import { pnFrontendUrlSelector } from "../../../store/reducers/backendStatus";
import { UIAttachment, UIMessageId } from "../../messages/types";
import { clipboardSetStringWithFeedback } from "../../../utils/clipboard";
import { LegacyMessageAttachments } from "../../messages/components/LegacyMessageAttachments";
import NavigationService from "../../../navigation/NavigationService";
import PN_ROUTES from "../navigation/routes";
import { PNMessage } from "../store/types/types";
import { NotificationPaymentInfo } from "../../../../definitions/pn/NotificationPaymentInfo";
Expand All @@ -33,6 +32,8 @@ import {
import { LevelEnum } from "../../../../definitions/content/SectionStatus";
import { ATTACHMENT_CATEGORY } from "../../messages/types/attachmentCategory";
import { maxVisiblePaymentCountGenerator } from "../utils";
import { MESSAGES_ROUTES } from "../../messages/navigation/routes";
import { useIONavigation } from "../../../navigation/params/AppParamsList";
import { LegacyMessageDetailsContent } from "./LegacyMessageDetailsContent";
import { MessageDetailsHeader } from "./MessageDetailsHeader";
import { MessageDetailsSection } from "./MessageDetailsSection";
Expand All @@ -59,6 +60,7 @@ export const LegacyMessageDetails = ({
const viewRef = createRef<View>();
const presentPaymentsBottomSheetRef = useRef<() => void>();
const frontendUrl = useIOSelector(pnFrontendUrlSelector);
const navigation = useIONavigation();

const partitionedAttachments = pipe(
message.attachments,
Expand All @@ -78,13 +80,19 @@ export const LegacyMessageDetails = ({
const openAttachment = useCallback(
(attachment: UIAttachment) => {
trackPNAttachmentOpening(attachment.category);
NavigationService.navigate(PN_ROUTES.MESSAGE_ATTACHMENT, {
messageId,
attachmentId: attachment.id,
category: attachment.category
navigation.navigate(MESSAGES_ROUTES.MESSAGES_NAVIGATOR, {
screen: PN_ROUTES.MAIN,
params: {
screen: PN_ROUTES.MESSAGE_ATTACHMENT,
params: {
messageId,
attachmentId: attachment.id,
category: attachment.category
}
}
});
},
[messageId]
[messageId, navigation]
);

const maxVisiblePaymentCount = maxVisiblePaymentCountGenerator();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ const WalletPaymentOutcomeScreen = () => {

const handleClose = () => {
if (paymentStartRoute) {
navigation.navigate(paymentStartRoute.routeName, {
// TODO: this is a workaround to solve type errors need to investigate deeply
navigation.navigate(paymentStartRoute.routeName as any, {
screen: paymentStartRoute.routeKey
});
return;
Expand Down
2 changes: 1 addition & 1 deletion ts/features/walletV3/payment/store/reducers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export type WalletPaymentState = {
authorizationUrl: pot.Pot<string, NetworkError>;
startRoute?: {
routeName: keyof AppParamsList;
routeKey: keyof NavigatorScreenParams<AppParamsList>["screen"];
routeKey: NavigatorScreenParams<AppParamsList>["screen"];
};
};

Expand Down
1 change: 0 additions & 1 deletion ts/screens/profile/DeveloperModeSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ import {
import { clipboardSetStringWithFeedback } from "../../utils/clipboard";
import { getDeviceId } from "../../utils/device";
import { isDevEnv } from "../../utils/environment";
import { useIODispatch, useIOSelector } from "../../store/hooks";
import { useIONavigation } from "../../navigation/params/AppParamsList";

import DSEnableSwitch from "./components/DSEnableSwitch";
Expand Down

0 comments on commit ddc5eb5

Please sign in to comment.