From 20d150cd99116a101cbdae7274349edabd7ada3a Mon Sep 17 00:00:00 2001 From: meiron03 Date: Fri, 30 Aug 2024 11:23:59 +0800 Subject: [PATCH] Fix logic in LaundryViewModel --- .../pennapps/labs/pennmobile/viewmodels/LaundryViewModel.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PennMobile/src/main/java/com/pennapps/labs/pennmobile/viewmodels/LaundryViewModel.kt b/PennMobile/src/main/java/com/pennapps/labs/pennmobile/viewmodels/LaundryViewModel.kt index d132fe59..11395453 100644 --- a/PennMobile/src/main/java/com/pennapps/labs/pennmobile/viewmodels/LaundryViewModel.kt +++ b/PennMobile/src/main/java/com/pennapps/labs/pennmobile/viewmodels/LaundryViewModel.kt @@ -108,10 +108,10 @@ class LaundryViewModel : ViewModel() { addUsage.join() if (addUsageSuccess && !addRoomSuccess) { - rooms.removeLast() + usages.removeLast() } if (!addUsageSuccess && addRoomSuccess) { - usages.removeLast() + rooms.removeLast() } } replaceFavorites(rooms, usages)