TF-1913 Fix thread view keeps reloading

(cherry picked from commit fc7ecd17f685b82bac98d808af450000e0f02c47)
This commit is contained in:
dab246
2023-06-19 12:07:33 +07:00
committed by Dat H. Pham
parent 68145165be
commit 64ad8ea049
4 changed files with 25 additions and 15 deletions
@@ -21,7 +21,7 @@ class StateDataSourceImpl extends StateDataSource {
@override
Future<State?> getState(AccountId accountId, UserName userName, StateType stateType) {
return Future.sync(() async {
final stateKey = TupleKey(stateType.value, accountId.asString, userName.value).encodeKey;
final stateKey = TupleKey(stateType.name, accountId.asString, userName.value).encodeKey;
final stateCache = await _stateCacheClient.getItem(stateKey);
return stateCache?.toState();
}).catchError(_exceptionThrower.throwException);
@@ -31,7 +31,7 @@ class StateDataSourceImpl extends StateDataSource {
Future<void> saveState(AccountId accountId, UserName userName, StateCache stateCache) {
return Future.sync(() async {
final stateCacheExist = await _stateCacheClient.isExistTable();
final stateKey = TupleKey(stateCache.type.value, accountId.asString, userName.value).encodeKey;
final stateKey = TupleKey(stateCache.type.name, accountId.asString, userName.value).encodeKey;
if (stateCacheExist) {
return await _stateCacheClient.updateItem(stateKey, stateCache);
} else {