Skip to content

Commit ba73727

Browse files
committed
wip
1 parent 5e44248 commit ba73727

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

packages/app-website-builder-workflows/src/Components/PagesList/PageListChangeStatus.tsx

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,21 @@ const decoratePage = (page: PageDto): WithWorkflowState<PageDto> => {
1717

1818
export const PageListChangeStatus = Browser.Page.Action.createDecorator(Original => {
1919
return function PageListChangeStatusAction(props) {
20-
const { page } = usePage();
20+
/**
21+
* This is wrong to do, but its here to show that this should work.
22+
* The component is inside the PageListConfig, so usePage should work
23+
*/
24+
let page: PageDto;
25+
try {
26+
page = usePage().page;
27+
} catch(ex) {
28+
console.log({
29+
error: ex.message,
30+
...props,
31+
})
32+
return <Original {...props} />;
33+
}
34+
// const { page } = usePage();
2135
const { state } = decoratePage(page);
2236
if (
2337
props.name !== "changeStatus" ||

0 commit comments

Comments
 (0)