From dcabc505fe433c3ebdbd10086da77843957352ae Mon Sep 17 00:00:00 2001 From: Steffen Date: Mon, 7 Dec 2020 21:53:20 +0100 Subject: [PATCH] show reminders from roles selected as bluff/other --- src/components/modals/ReminderModal.vue | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/components/modals/ReminderModal.vue b/src/components/modals/ReminderModal.vue index 812391c..e395d29 100644 --- a/src/components/modals/ReminderModal.vue +++ b/src/components/modals/ReminderModal.vue @@ -36,8 +36,9 @@ export default { computed: { availableReminders() { let reminders = []; - const players = this.$store.state.players.players; + const { players, bluffs } = this.$store.state.players; this.$store.state.roles.forEach(role => { + // add reminders from player roles if (players.some(p => p.role.id === role.id)) { reminders = [ ...reminders, @@ -48,7 +49,19 @@ export default { })) ]; } - if (role.remindersGlobal && role.remindersGlobal.length) { + // add reminders from bluff/other roles + else if (bluffs.some(bluff => bluff.id === role.id)) { + reminders = [ + ...reminders, + ...role.reminders.map(name => ({ + role: role.id, + image: role.image, + name + })) + ]; + } + // add global reminders + else if (role.remindersGlobal && role.remindersGlobal.length) { reminders = [ ...reminders, ...role.remindersGlobal.map(name => ({ @@ -59,6 +72,7 @@ export default { ]; } }); + // add fabled reminders this.$store.state.players.fabled.forEach(role => { reminders = [ ...reminders,