diff --git a/components/pages/workPageLayout/WorkPageLayout.tsx b/components/pages/workPageLayout/WorkPageLayout.tsx index b9d9e8e4..665fa1e4 100644 --- a/components/pages/workPageLayout/WorkPageLayout.tsx +++ b/components/pages/workPageLayout/WorkPageLayout.tsx @@ -27,7 +27,7 @@ function WorkPageLayout({ wid }: { wid: string }) { {identifier && ( )} diff --git a/components/shared/publizonReader/PublizonReader.tsx b/components/shared/publizonReader/PublizonReader.tsx index 45eb891d..2dcde1b0 100644 --- a/components/shared/publizonReader/PublizonReader.tsx +++ b/components/shared/publizonReader/PublizonReader.tsx @@ -9,15 +9,17 @@ type ReaderType = | { type: "demo" identifier: string + orderId?: never onBackCallback: () => void } | { type: "rent" + identifier?: never orderId: string onBackCallback: () => void } -const Reader = (props: ReaderType) => { +const Reader = ({ type, onBackCallback, identifier, orderId }: ReaderType) => { useEffect(() => { readerAssets.forEach(appendAsset) @@ -26,7 +28,7 @@ const Reader = (props: ReaderType) => { // @ts-ignore // eslint-disable-next-line @typescript-eslint/no-shadow window.onReaderBackCallback = () => { - props.onBackCallback() + onBackCallback() } return () => { @@ -35,16 +37,16 @@ const Reader = (props: ReaderType) => { delete window.onReaderBackCallback readerAssets.forEach(removeAsset) } - }, [props]) + }, []) - if (props.type === "rent") { + if (type === "rent") { return (
orderId: {props.orderId}
+orderId: {orderId}