File tree Expand file tree Collapse file tree
java/eu/theappfactory/dailyrecipes Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -257,7 +257,7 @@ class FirestoreUserEventDataSource @Inject constructor(
257257
258258 override suspend fun updateUser (user : UserResponse ) =
259259 suspendCancellableCoroutine<Result <UpdateUserStatus >> { continuation ->
260- val result = checkIfUsernameExists(user.username)
260+ val result = checkIfUsernameExists(user.username, user.id )
261261
262262 when (result) {
263263 is Result .Success -> {
@@ -316,7 +316,7 @@ class FirestoreUserEventDataSource @Inject constructor(
316316 }
317317 }
318318
319- private fun checkIfUsernameExists (username : String ): Result <UpdateUserStatus > {
319+ private fun checkIfUsernameExists (username : String , id : String ): Result <UpdateUserStatus > {
320320 val users = ArrayList <UserResponse >()
321321 val itemSnapshot = firestore.collection(USERS_COLLECTION ).get()
322322
@@ -346,7 +346,7 @@ class FirestoreUserEventDataSource @Inject constructor(
346346 it.username.equals(username, ignoreCase = true )
347347 }
348348
349- if (count == 0 ) {
349+ if (count == 0 || users.find { it.username == username }?.id == id ) {
350350 return Result .Success (UpdateUserStatus .UPDATE_OK )
351351 } else {
352352 return Result .Error (Exception (" username is taken." ))
Original file line number Diff line number Diff line change @@ -427,7 +427,9 @@ class ItemHolder(
427427 binding.videoView.hideController()
428428 if (item.showThumbnail && item.imageUri.isNotEmpty()) {
429429 binding.loadingFrame.postDelayed({
430- binding.videoView.player?.playWhenReady = true
430+ if (itemView.isAttachedToWindow) {
431+ binding.videoView.player?.playWhenReady = true
432+ }
431433 }, PAN_ANIMATION_DURATION )
432434 } else {
433435 binding.videoView.player?.playWhenReady = true
Original file line number Diff line number Diff line change 1313 android : layout_width =" match_parent"
1414 android : layout_height =" match_parent"
1515 android : layout_gravity =" center"
16+ app : keep_content_on_player_reset =" true"
1617 app : use_controller =" false" />
1718
1819 <ImageView
You can’t perform that action at this time.
0 commit comments