From f043c41e12b1e4cc83b949d13949ef024dc77104 Mon Sep 17 00:00:00 2001 From: Stefan Zermatten Date: Sat, 14 Aug 2021 10:44:17 +0200 Subject: [PATCH] Fixed fab being confused by hiding the spells tab --- .../ui/creature/character/CharacterSheetFab.vue | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/app/imports/ui/creature/character/CharacterSheetFab.vue b/app/imports/ui/creature/character/CharacterSheetFab.vue index 829424e2..721f9811 100644 --- a/app/imports/ui/creature/character/CharacterSheetFab.vue +++ b/app/imports/ui/creature/character/CharacterSheetFab.vue @@ -44,6 +44,7 @@ import { getHighestOrder } from '/imports/api/parenting/order.js'; import insertProperty from '/imports/api/creature/creatureProperties/methods/insertProperty.js'; import CreatureProperties from '/imports/api/creature/creatureProperties/CreatureProperties.js'; + import Creatures from '/imports/api/creature/creatures/Creatures.js'; import PROPERTIES from '/imports/constants/PROPERTIES.js'; import insertPropertyFromLibraryNode from '/imports/api/creature/creatureProperties/methods/insertPropertyFromLibraryNode.js'; import fetchDocByRef from '/imports/api/parenting/fetchDocByRef.js'; @@ -119,7 +120,11 @@ return this.$route.params.id; }, tabNumber(){ - return this.$store.getters.tabById(this.creatureId); + let tabNumber = this.$store.getters.tabById(this.creatureId); + if (this.hideSpellsTab && tabNumber > 2){ + tabNumber += 1; + } + return tabNumber; }, speedDials(){ return this.speedDialsByTab[tabs[this.tabNumber]]; @@ -136,6 +141,12 @@ return PROPERTIES; }, }, + meteor: { + hideSpellsTab(){ + let creature = Creatures.findOne(this.creatureId); + return creature?.settings.hideSpellsTab; + }, + }, methods: { getPropertyLabel(type){ if (type === 'buff') return 'Buff or Condition';