diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/data/api/edziennik/librus/data/api/LibrusApiPushConfig.kt b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/edziennik/librus/data/api/LibrusApiPushConfig.kt index 09142cc5..9073d03f 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/data/api/edziennik/librus/data/api/LibrusApiPushConfig.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/edziennik/librus/data/api/LibrusApiPushConfig.kt @@ -21,6 +21,14 @@ class LibrusApiPushConfig(override val data: DataLibrus, } init { data.app.config.sync.tokenLibrus?.also { tokenLibrus -> + if(tokenLibrus.isEmpty()) { + data.setSyncNext(ENDPOINT_LIBRUS_API_PUSH_CONFIG, SYNC_ALWAYS) + data.app.config.sync.tokenLibrusList = + data.app.config.sync.tokenLibrusList + profileId + onSuccess(ENDPOINT_LIBRUS_API_PUSH_CONFIG) + return@also + } + apiGet(TAG, "ChangeRegister", payload = JsonObject( "provider" to "FCM", "device" to tokenLibrus,