Skip to content

Commit 9227a1a

Browse files
authored
fix: fix reminders (monicahq/chandler#154)
1 parent 385f25c commit 9227a1a

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

domains/Vault/ManageVault/Web/ViewHelpers/VaultReminderIndexViewHelper.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ public static function data(Vault $vault, User $user): Collection
6363
$reminder = ContactReminder::where('id', $contactReminderScheduled->contact_reminder_id)->with('contact')->first();
6464
$contact = $reminder->contact;
6565

66+
if ($contact->vault_id !== $vault->id) {
67+
continue;
68+
}
69+
6670
$remindersCollection->push([
6771
'id' => $reminder->id,
6872
'label' => $reminder->label,

domains/Vault/ManageVault/Web/ViewHelpers/VaultShowViewHelper.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ public static function upcomingReminders(Vault $vault, User $user): array
6565
$reminder = ContactReminder::where('id', $contactReminderScheduled->contact_reminder_id)->with('contact')->first();
6666
$contact = $reminder->contact;
6767

68+
if ($contact->vault_id !== $vault->id) {
69+
continue;
70+
}
71+
6872
$scheduledAtDate = Carbon::createFromFormat('Y-m-d H:i:s', $contactReminderScheduled->scheduled_at);
6973

7074
$remindersCollection->push([

resources/js/Pages/Vault/Dashboard/Partials/UpcomingReminders.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
<div v-if="data.reminders.length > 0">
4747
<ul class="mb-4 rounded-lg border border-gray-200 bg-white">
4848
<li
49-
v-for="reminder in data"
49+
v-for="reminder in data.reminders"
5050
:key="reminder.id"
5151
class="item-list border-b border-gray-200 px-3 py-2 hover:bg-slate-50">
5252
<div class="flex items-center">

0 commit comments

Comments
 (0)