diff --git a/src/hooks/useBackgroundTask.ts b/src/hooks/useBackgroundTask.ts new file mode 100644 index 000000000..eb477706f --- /dev/null +++ b/src/hooks/useBackgroundTask.ts @@ -0,0 +1,6 @@ +import BackgroundTasksContext from "@saleor/containers/BackgroundTasks/context"; +import { useContext } from "react"; + +const useBackgroundTask = useContext(BackgroundTasksContext); + +export default useBackgroundTask; diff --git a/src/index.tsx b/src/index.tsx index 45625ac19..2c30b3571 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -35,6 +35,7 @@ import { WindowTitle } from "./components/WindowTitle"; import { API_URI, APP_MOUNT_URI, GTM_ID } from "./config"; import ConfigurationSection, { createConfigurationMenu } from "./configuration"; import AppStateProvider from "./containers/AppState"; +import BackgroundTasksProvider from "./containers/BackgroundTasks"; import { CustomerSection } from "./customers"; import DiscountSection from "./discounts"; import HomePage from "./home"; @@ -135,11 +136,13 @@ const App: React.FC = () => { - - - - - + + + + + + +