Fix crash when interacting with notifications. Fixes #1218

This commit is contained in:
Phillip Thelen 2019-08-24 13:14:45 +02:00
parent 2899bbdbfa
commit 1bb01256fc
2 changed files with 4 additions and 4 deletions

View file

@ -326,13 +326,13 @@ interface ApiService {
// Notifications
@POST("notifications/{notificationId}/read")
fun readNotification(@Path("notificationId") notificationId: String): Flowable<HabitResponse<List<*>>>
fun readNotification(@Path("notificationId") notificationId: String): Flowable<HabitResponse<List<Any>>>
@POST("notifications/read")
fun readNotifications(@Body notificationIds: Map<String, List<String>>): Flowable<HabitResponse<List<*>>>
fun readNotifications(@Body notificationIds: Map<String, List<String>>): Flowable<HabitResponse<List<Any>>>
@POST("notifications/see")
fun seeNotifications(@Body notificationIds: Map<String, List<String>>): Flowable<HabitResponse<List<*>>>
fun seeNotifications(@Body notificationIds: Map<String, List<String>>): Flowable<HabitResponse<List<Any>>>
@POST("user/open-mystery-item")
fun openMysteryItem(): Flowable<HabitResponse<Equipment>>

View file

@ -187,7 +187,7 @@ open class NotificationsViewModel : BaseViewModel() {
* instead of one of the ones coming from server.
*/
private fun isCustomNotification(notification: Notification): Boolean {
return notification.id.startsWith("custom-")
return notification.id.startsWith("custom-") || notification.id == "new-stuff-notification"
}
fun dismissNotification(notification: Notification) {