From 68fd94cb7a02a0fad4901bd2f165a1ac545f7d7c Mon Sep 17 00:00:00 2001 From: Eonji-sw Date: Tue, 26 Nov 2024 13:07:02 +0900 Subject: [PATCH] =?UTF-8?q?#121=20[MOD]=20:=20suspend=20->=20scope=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/teamwable/news/NewsViewModel.kt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/feature/news/src/main/java/com/teamwable/news/NewsViewModel.kt b/feature/news/src/main/java/com/teamwable/news/NewsViewModel.kt index d5ceba6c..1f434005 100644 --- a/feature/news/src/main/java/com/teamwable/news/NewsViewModel.kt +++ b/feature/news/src/main/java/com/teamwable/news/NewsViewModel.kt @@ -71,9 +71,17 @@ class NewsViewModel suspend fun getNewsNumberFromLocal() = userInfoRepository.getNewsNumber().first() - suspend fun saveNewsNumber(newsNumber: Int) = userInfoRepository.saveNewsNumber(newsNumber) + fun saveNewsNumber(newsNumber: Int) { + viewModelScope.launch { + userInfoRepository.saveNewsNumber(newsNumber) + } + } suspend fun getNoticeNumberFromLocal() = userInfoRepository.getNoticeNumber().first() - suspend fun saveNoticeNumber(noticeNumber: Int) = userInfoRepository.saveNoticeNumber(noticeNumber) + fun saveNoticeNumber(noticeNumber: Int) { + viewModelScope.launch { + userInfoRepository.saveNoticeNumber(noticeNumber) + } + } }