mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 12:23:58 +01:00
* fix the issue with contributions not appearing after logging in again * fix old contribution appearing on top Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
This commit is contained in:
parent
0fb2f1b7be
commit
2b62d8487b
4 changed files with 25 additions and 0 deletions
|
|
@ -38,4 +38,15 @@ abstract class ContinuationClient<Network, Domain> {
|
|||
continuationStore.remove("$prefix$category")
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the existing the key from continuationExists and continuationStore
|
||||
*
|
||||
* @param prefix
|
||||
* @param userName the username
|
||||
*/
|
||||
protected fun resetUserContinuation(prefix: String, userName: String) {
|
||||
continuationExists.remove("$prefix$userName")
|
||||
continuationStore.remove("$prefix$userName")
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,6 +27,9 @@ class ContributionBoundaryCallback @Inject constructor(
|
|||
* network
|
||||
*/
|
||||
override fun onZeroItemsLoaded() {
|
||||
if (sessionManager.userName != null) {
|
||||
mediaClient.resetUserNameContinuation(sessionManager.userName!!)
|
||||
}
|
||||
fetchContributions()
|
||||
}
|
||||
|
||||
|
|
@ -66,6 +69,8 @@ class ContributionBoundaryCallback @Inject constructor(
|
|||
)
|
||||
}
|
||||
)
|
||||
}else {
|
||||
compositeDisposable.clear()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@ public class DBOpenHelper extends SQLiteOpenHelper {
|
|||
public void deleteTable(SQLiteDatabase db, String tableName) {
|
||||
try {
|
||||
db.execSQL(String.format(DROP_TABLE_STATEMENT, tableName));
|
||||
onCreate(db);
|
||||
} catch (SQLiteException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -149,6 +149,14 @@ class MediaClient @Inject constructor(
|
|||
resetContinuation(CATEGORY_CONTINUATION_PREFIX, category)
|
||||
}
|
||||
|
||||
/**
|
||||
* Call the resetUserContinuation method
|
||||
*
|
||||
* @param userName the username
|
||||
*/
|
||||
fun resetUserNameContinuation(userName: String) =
|
||||
resetUserContinuation("user_", userName)
|
||||
|
||||
override fun responseMapper(
|
||||
networkResult: Single<MwQueryResponse>,
|
||||
key: String?
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue