From 64a9e43145b98fa5995bdba0e23d1220386ccc5a Mon Sep 17 00:00:00 2001 From: Woohyeok Choi Date: Mon, 26 Oct 2020 12:22:23 +0900 Subject: [PATCH] Fix Issue #78 --- .../kaist/iclab/abclogger/ui/survey/SurveyViewModel.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/kaist/iclab/abclogger/ui/survey/SurveyViewModel.kt b/app/src/main/kotlin/kaist/iclab/abclogger/ui/survey/SurveyViewModel.kt index 796d47d..56b6a84 100644 --- a/app/src/main/kotlin/kaist/iclab/abclogger/ui/survey/SurveyViewModel.kt +++ b/app/src/main/kotlin/kaist/iclab/abclogger/ui/survey/SurveyViewModel.kt @@ -109,8 +109,7 @@ class SurveyViewModel( ) dataRepository.put(updatedSurvey) - dataRepository.put(responses) - + responses.forEach { dataRepository.put(it) } dataRepository.put(toSurveyEntity(updatedSurvey, responses)) saveStatusChannel.send(State.Success(Unit)) } catch (e: Exception) { @@ -133,7 +132,9 @@ class SurveyViewModel( } toSurveyEntity(survey, responses) } - dataRepository.put(expiredEntities) + expiredEntities.forEach { + dataRepository.put(it) + } } catch (e: Exception) { } }