X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=resources%2Fjs%2Fhelpers%2FTechnique.js;h=7388ccb97bb5c3d7cb8816277a4e340235eef0f8;hb=cce28e8619fe87d4be33f82df9a5ec16b2ad9cf6;hp=b289341d34833bbb4b99262885522786260da515;hpb=8e274ddec45800cd727bb7138683b81cf2f7dcb1;p=alttp.git diff --git a/resources/js/helpers/Technique.js b/resources/js/helpers/Technique.js index b289341..7388ccb 100644 --- a/resources/js/helpers/Technique.js +++ b/resources/js/helpers/Technique.js @@ -1,6 +1,12 @@ import i18n from '../i18n'; export const getLink = tech => { + if (tech.type === 'dungeon') { + return `/dungeons/${tech.name}`; + } + if (tech.type === 'location') { + return `/locations/${tech.name}`; + } if (tech.type === 'mode') { return `/modes/${tech.name}`; } @@ -32,6 +38,7 @@ export const getMatchedLocale = (tech, lang) => { }; export const getTranslation = (tech, prop, lang) => { + if (!tech) return ''; const direct = tech.translations.find(t => t.locale === lang); if (direct) { return direct[prop];