From ee8f497644102c514ebf0bfdd8f2ab4599dfc7d0 Mon Sep 17 00:00:00 2001 From: sim Date: Tue, 29 Aug 2023 23:05:41 +0200 Subject: [PATCH] Use non-nullable ApiResponse in Api --- .../java/org/unifiedpush/distributor/nextpush/api/Api.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/org/unifiedpush/distributor/nextpush/api/Api.kt b/app/src/main/java/org/unifiedpush/distributor/nextpush/api/Api.kt index e5cfe0f..44df8de 100644 --- a/app/src/main/java/org/unifiedpush/distributor/nextpush/api/Api.kt +++ b/app/src/main/java/org/unifiedpush/distributor/nextpush/api/Api.kt @@ -52,7 +52,7 @@ class Api(val context: Context) { apiProvider.createDevice(parameters) ?.subscribeOn(Schedulers.io()) ?.observeOn(AndroidSchedulers.mainThread()) - ?.subscribe(object : DisposableObserver() { + ?.subscribe(object : DisposableObserver() { override fun onNext(response: ApiResponse) { response.deviceId.let { context.deviceId = it @@ -102,7 +102,7 @@ class Api(val context: Context) { apiProvider.deleteDevice(deviceId) ?.subscribeOn(Schedulers.io()) ?.observeOn(AndroidSchedulers.mainThread()) - ?.subscribe(object : DisposableObserver() { + ?.subscribe(object : DisposableObserver() { override fun onNext(response: ApiResponse) { if (response.success) { Log.d(TAG, "Device successfully deleted.") @@ -145,7 +145,7 @@ class Api(val context: Context) { apiProvider.createApp(parameters) ?.subscribeOn(Schedulers.io()) ?.observeOn(AndroidSchedulers.mainThread()) - ?.subscribe(object : DisposableObserver() { + ?.subscribe(object : DisposableObserver() { override fun onNext(response: ApiResponse) { val nextpushToken = if (response.success) { Log.d(TAG, "App successfully created.") @@ -179,7 +179,7 @@ class Api(val context: Context) { apiProvider.deleteApp(nextpushToken) ?.subscribeOn(Schedulers.io()) ?.observeOn(AndroidSchedulers.mainThread()) - ?.subscribe(object : DisposableObserver() { + ?.subscribe(object : DisposableObserver() { override fun onNext(response: ApiResponse) { if (response.success) { Log.d(TAG, "App successfully deleted.")