New source found from dndbeyond.com
This commit is contained in:
@@ -1,9 +1,6 @@
|
||||
import { flatten } from "lodash";
|
||||
|
||||
import {
|
||||
featureFlagInfoSelectors,
|
||||
rulesEngineSelectors,
|
||||
} from "@dndbeyond/character-rules-engine";
|
||||
import { rulesEngineSelectors } from "@dndbeyond/character-rules-engine";
|
||||
|
||||
import config from "~/config";
|
||||
import { NavigationType } from "~/subApps/builder/constants";
|
||||
@@ -26,10 +23,7 @@ export function checkStdBuilderPageRequirements(routeDef, state) {
|
||||
builderSelectors.getBuilderMethod(state) !== null &&
|
||||
checkIsRouteInNavConfig(
|
||||
routeDef,
|
||||
navConfig.getNavBuilderConfig(
|
||||
builderSelectors.getBuilderMethod(state),
|
||||
featureFlagInfoSelectors.getFeatureFlagInfo(state)
|
||||
)
|
||||
navConfig.getNavBuilderConfig(builderSelectors.getBuilderMethod(state))
|
||||
)
|
||||
);
|
||||
}
|
||||
@@ -73,11 +67,10 @@ export function getRoutePathIdxByPath(path, routePathDef, characterId = 0) {
|
||||
}
|
||||
|
||||
export function getCurrentSectionHelpRoutePath(state) {
|
||||
const currentPath = builderSelectors.getCurrentPath(state);
|
||||
const currentPath = builderSelectors.getCurrentPath();
|
||||
const sections = navConfig.getNavigationSections(
|
||||
builderSelectors.getBuilderMethod(state),
|
||||
navConfig.getCurrentRouteDef(currentPath),
|
||||
featureFlagInfoSelectors.getFeatureFlagInfo(state)
|
||||
navConfig.getCurrentRouteDef(currentPath)
|
||||
);
|
||||
const currentSection = sections.find((section) => section.active);
|
||||
const currentSectionHelpRoute = currentSection.routes.find(
|
||||
@@ -92,16 +85,18 @@ export function getCurrentSectionHelpRoutePath(state) {
|
||||
}
|
||||
|
||||
export function getAvailablePathRedirect(state) {
|
||||
const currentPath = builderSelectors.getCurrentPath(state);
|
||||
const currentPath = builderSelectors.getCurrentPath();
|
||||
const currentSearch = builderSelectors.getCurrentSearchParams();
|
||||
const routePathing = builderSelectors.getRoutePathing(state);
|
||||
const characterId = rulesEngineSelectors.getId(state);
|
||||
const currentRoutePathIdx = getRoutePathIdxByPath(
|
||||
currentPath,
|
||||
`${currentPath}${currentSearch}`,
|
||||
routePathing,
|
||||
characterId
|
||||
);
|
||||
|
||||
const currentRoutePathingNode = routePathing[currentRoutePathIdx];
|
||||
|
||||
if (!currentRoutePathingNode.available) {
|
||||
for (let i = currentRoutePathIdx; i < routePathing.length; i++) {
|
||||
if (routePathing[i].available) {
|
||||
@@ -144,15 +139,15 @@ export const getAvailableNextRoute = (routeDef, state) => {
|
||||
};
|
||||
|
||||
export function getCharacterBuilderUrl(characterId): string {
|
||||
return `${BASE_PATHNAME}/${characterId}/builder`;
|
||||
return getUrlWithParams(`${BASE_PATHNAME}/${characterId}/builder`);
|
||||
}
|
||||
|
||||
export function getCharacterSheetUrl(characterId): string {
|
||||
return `${BASE_PATHNAME}/${characterId}`;
|
||||
return getUrlWithParams(`${BASE_PATHNAME}/${characterId}`);
|
||||
}
|
||||
|
||||
export function getCharacterListingUrl(): string {
|
||||
return `${BASE_PATHNAME}`;
|
||||
return getUrlWithParams(`${BASE_PATHNAME}`);
|
||||
}
|
||||
|
||||
export function getUrlWithParams(url?: string): string {
|
||||
|
||||
Reference in New Issue
Block a user