diff --git a/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/ui/UiModule.kt b/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/ui/UiModule.kt index 5e644fbb..34ad42e0 100644 --- a/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/ui/UiModule.kt +++ b/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/ui/UiModule.kt @@ -32,6 +32,7 @@ val uiModule = module { feedbackDialogFactory = get(), syncService = get(), notificationSchedulingService = get(), + notificationService = get(), feedbackService = get(), settingsGateway = get(), ) @@ -78,6 +79,7 @@ val uiModule = module { settingsGateway = get(), feedbackDialogFactory = get(), feedbackService = get(), + notificationService = get(), ) } single { SpeakerListItemViewModel.Factory() } diff --git a/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/viewmodel/ApplicationViewModel.kt b/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/viewmodel/ApplicationViewModel.kt index f1163518..392bf565 100644 --- a/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/viewmodel/ApplicationViewModel.kt +++ b/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/viewmodel/ApplicationViewModel.kt @@ -3,6 +3,7 @@ package co.touchlab.droidcon.viewmodel import co.touchlab.droidcon.application.gateway.SettingsGateway import co.touchlab.droidcon.application.service.Notification import co.touchlab.droidcon.application.service.NotificationSchedulingService +import co.touchlab.droidcon.application.service.NotificationService import co.touchlab.droidcon.domain.service.FeedbackService import co.touchlab.droidcon.domain.service.SyncService import co.touchlab.droidcon.service.DeepLinkNotificationHandler @@ -21,6 +22,7 @@ class ApplicationViewModel( private val feedbackDialogFactory: FeedbackDialogViewModel.Factory, private val syncService: SyncService, private val notificationSchedulingService: NotificationSchedulingService, + private val notificationService: NotificationService, private val feedbackService: FeedbackService, private val settingsGateway: SettingsGateway, ) : BaseViewModel(), DeepLinkNotificationHandler { @@ -88,6 +90,7 @@ class ApplicationViewModel( session, submit = { feedback -> feedbackService.submit(session, feedback) + notificationService.cancel(listOf(session.id)) presentNextFeedback() }, closeAndDisable = { diff --git a/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/viewmodel/session/SessionDetailViewModel.kt b/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/viewmodel/session/SessionDetailViewModel.kt index bc1d1268..6d954abb 100644 --- a/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/viewmodel/session/SessionDetailViewModel.kt +++ b/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/viewmodel/session/SessionDetailViewModel.kt @@ -1,6 +1,7 @@ package co.touchlab.droidcon.viewmodel.session import co.touchlab.droidcon.application.gateway.SettingsGateway +import co.touchlab.droidcon.application.service.NotificationService import co.touchlab.droidcon.domain.composite.ScheduleItem import co.touchlab.droidcon.domain.gateway.SessionGateway import co.touchlab.droidcon.domain.service.DateTimeService @@ -31,6 +32,7 @@ class SessionDetailViewModel( private val dateTimeService: DateTimeService, private val parseUrlViewService: ParseUrlViewService, private val feedbackService: FeedbackService, + private val notificationService: NotificationService, initialItem: ScheduleItem, ) : BaseViewModel() { @@ -126,6 +128,7 @@ class SessionDetailViewModel( item.session, submit = { feedback -> feedbackService.submit(item.session, feedback) + notificationService.cancel(listOf(item.session.id)) presentedFeedback = null }, closeAndDisable = null, @@ -156,6 +159,7 @@ class SessionDetailViewModel( private val dateTimeService: DateTimeService, private val parseUrlViewService: ParseUrlViewService, private val feedbackService: FeedbackService, + private val notificationService: NotificationService, ) { fun create( @@ -170,6 +174,7 @@ class SessionDetailViewModel( dateTimeService, parseUrlViewService, feedbackService, + notificationService, item, ) }