This commit is contained in:
Valere 2019-07-09 15:36:12 +02:00
parent fa81d1a9c7
commit 1a4157a663
3 changed files with 32 additions and 0 deletions

View file

@ -1,3 +1,18 @@
/*
* Copyright 2019 New Vector Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package im.vector.matrix.android.api.session
import androidx.annotation.StringRes

View file

@ -1,3 +1,18 @@
/*
* Copyright 2019 New Vector Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package im.vector.matrix.android.internal.session
import androidx.lifecycle.LiveData
@ -51,6 +66,7 @@ class DefaultInitialSyncProgressService @Inject constructor() : InitialSyncProgr
}
fun endAll() {
rootTask = null
this@DefaultInitialSyncProgressService.status.postValue(null)
}

View file

@ -63,6 +63,7 @@ internal class DefaultSyncTask @Inject constructor(private val syncAPI: SyncAPI,
val isInitialSync = token == null
if (isInitialSync) {
initialSyncProgressService.endAll()
initialSyncProgressService.startTask(R.string.initial_sync_start_importing_account, 100)
}
return executeRequest<SyncResponse> {