From 005a3fbd67ec5cef95d55e0e49e508c20e5d96c7 Mon Sep 17 00:00:00 2001 From: NiraliSonani Date: Wed, 27 Nov 2024 18:28:17 +0530 Subject: [PATCH] Checked user permission for open note --- .../Expense/Expense Detail/ExpenseDetailsViewModel.swift | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Splito/UI/Home/Expense/Expense Detail/ExpenseDetailsViewModel.swift b/Splito/UI/Home/Expense/Expense Detail/ExpenseDetailsViewModel.swift index 6e11ee780..4ea0093f9 100644 --- a/Splito/UI/Home/Expense/Expense Detail/ExpenseDetailsViewModel.swift +++ b/Splito/UI/Home/Expense/Expense Detail/ExpenseDetailsViewModel.swift @@ -116,8 +116,9 @@ class ExpenseDetailsViewModel: BaseViewModel, ObservableObject { } func handleNoteTap() { - guard let expense else { return } - showAddNoteEditor = expense.isActive + guard let expense, expense.isActive, let userId = preference.user?.id, + let group, group.members.contains(userId) else { return } + showAddNoteEditor = true } func handleEditBtnAction() {