]> git.localhorst.tv Git - alttp.git/blobdiff - resources/js/helpers/Technique.js
basic content editing
[alttp.git] / resources / js / helpers / Technique.js
index b289341d34833bbb4b99262885522786260da515..7388ccb97bb5c3d7cb8816277a4e340235eef0f8 100644 (file)
@@ -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];