diff --git a/components/core/Upload/Provider.js b/components/core/Upload/Provider.js index 71fb2e76..27b790bc 100644 --- a/components/core/Upload/Provider.js +++ b/components/core/Upload/Provider.js @@ -23,6 +23,8 @@ export const Provider = ({ children, page, data, viewer }) => { viewer, }); + useEventListener({ type: "open-upload-jumper", handler: showUploadJumper }); + const providerValue = React.useMemo( () => [ { ...uploadState, isUploadJumperVisible }, diff --git a/components/core/Upload/index.js b/components/core/Upload/index.js index 3adb2b75..7ce9de78 100644 --- a/components/core/Upload/index.js +++ b/components/core/Upload/index.js @@ -32,13 +32,12 @@ const Root = ({ children, data }) => { * -----------------------------------------------------------------------------------------------*/ const Trigger = ({ viewer, css, children, ...props }) => { - const [, { showUploadJumper }] = useUploadContext(); const showUploadModal = () => { if (!viewer) { Events.dispatchCustomEvent({ name: "slate-global-open-cta", detail: {} }); return; } - showUploadJumper(); + Events.dispatchCustomEvent({ name: "open-upload-jumper" }); }; return (