File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
packages/app-website-builder-workflows/src/Components/PagesList Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,21 @@ const decoratePage = (page: PageDto): WithWorkflowState<PageDto> => {
1717
1818export 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" ||
You can’t perform that action at this time.
0 commit comments