Skip to content

Commit

Permalink
Merge pull request #68 from mtklass/further-regression-fixes
Browse files Browse the repository at this point in the history
Fix incorrect redirects and some navigation issues
  • Loading branch information
connorhsm authored Oct 2, 2024
2 parents 800beee + 943b892 commit d15c006
Show file tree
Hide file tree
Showing 7 changed files with 877 additions and 823 deletions.
12 changes: 6 additions & 6 deletions src/components/ObjectInspector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ import 'tippy.js/animations/scale.css'
import 'tippy.js/animations/shift-away.css'
import 'tippy.js/animations/shift-toward.css'
export default defineComponent({
export default {
components: {
ObjectImage,
BiomeImage,
Expand All @@ -170,17 +170,17 @@ export default defineComponent({
}
};
onMounted(() => {
loadObject();
});
watch(
() => route.params.id,
() => {
loadObject();
}
);
onMounted(() => {
loadObject();
});
const biomes = computed(() => {
return object.value?.data?.biomes?.map(biomeData => Biome.find(biomeData.id.toString())) || [];
});
Expand Down Expand Up @@ -333,7 +333,7 @@ export default defineComponent({
metaInfo() {
return { title: this.object?.name };
},
});
};
</script>
<style scoped lang="scss">
Expand Down
7 changes: 4 additions & 3 deletions src/components/ObjectSearch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ export default {
placeholderVal.value = "Search";
} else {
let newSelectedObject = GameObject.find(route?.params?.id.split('-')[0]);
selectedObject.value = GameObject.find(route?.params?.id.split('-')[0]);
if (VueSelectElem.value) VueSelectElem.value.mutableValue = newSelectedObject.name;
if (VueSelectElem.value) VueSelectElem.value.mutableValue = newSelectedObject;
}
}),
);
Expand All @@ -66,8 +65,10 @@ export default {
newSelectedObject = object;
}
if (newSelectedObject === selectedObject.value) return;
if (newSelectedObject)
if (newSelectedObject) {
selectedObject.value = newSelectedObject;
router.push(newSelectedObject.url());
}
};
return {
Expand Down
6 changes: 3 additions & 3 deletions src/components/Recipe.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@

<h3 v-if="loading || !objectData">Loading...</h3>
<div v-else class="steps">
<RecipeIngredients v-if="objectData.recipe.ingredients" :ingredients="objectData.recipe.ingredients" :rightClickObject="filterObject" />
<RecipeIngredients v-if="objectData.recipe?.ingredients" :ingredients="objectData.recipe?.ingredients" :rightClickObject="filterObject" />
<RecipeIngredients v-if="objectData.recipe.uncraftables" title="UNCRAFTABLE Ingredients" :ingredients="objectData.recipe.uncraftables" :rightClickObject="filterObject" />
<RecipeIngredients v-if="objectData.recipe?.uncraftables" title="UNCRAFTABLE Ingredients" :ingredients="objectData.recipe?.uncraftables" :rightClickObject="filterObject" />
<div class="filterHeadline" v-if="filteredObject">
<h4>Filter:</h4>
Expand All @@ -31,7 +31,7 @@
</div>
<RecipeStep
v-for="(transitions, index) in objectData.recipe.steps"
v-for="(transitions, index) in objectData.recipe?.steps"
:transitions="transitions"
:number="index + 1"
:key="index"
Expand Down
Loading

0 comments on commit d15c006

Please sign in to comment.