diff --git a/src/actions.ts b/src/actions.ts index a07962c95..e89b60dfe 100644 --- a/src/actions.ts +++ b/src/actions.ts @@ -27,7 +27,8 @@ import { DiagnosticsData, FeatureFlags, SitewideAnnouncementsData, - StatisticsData, DashboardURIData, + StatisticsData, + DashboardURIData, } from "./interfaces"; import { CollectionData } from "@thepalaceproject/web-opds-client/lib/interfaces"; import DataFetcher from "@thepalaceproject/web-opds-client/lib/DataFetcher"; @@ -194,8 +195,7 @@ export default class ActionCreator extends BaseActionCreator { static readonly RESET_ADOBE_ID = "RESET_ADOBE_ID"; static readonly DIAGNOSTICS = "DIAGNOSTICS"; - - static readonly DASHBOARD_URI : "DASHBOARD_URI" + static readonly DASHBOARD_URI: "DASHBOARD_URI"; csrfToken: string; @@ -1101,10 +1101,8 @@ export default class ActionCreator extends BaseActionCreator { fetchDashboardUri(dashboardId: string) { const url = "/admin/quicksight_embed/" + dashboardId; return this.fetchJSON( - ActionCreator.DASHBOARD_URI, - url + ActionCreator.DASHBOARD_URI, + url ).bind(this); } - } - diff --git a/src/components/DashboardPage.tsx b/src/components/DashboardPage.tsx index 79a350478..101ccfe97 100644 --- a/src/components/DashboardPage.tsx +++ b/src/components/DashboardPage.tsx @@ -32,12 +32,14 @@ export default class DashboardPage extends React.Component { library: PropTypes.func, }; + getChildContext() { return { library: () => this.props.params.library, }; } + render(): JSX.Element { const { library } = this.props.params; return ( @@ -45,11 +47,12 @@ export default class DashboardPage extends React.Component {
+ - +