Page MenuHomePhabricator

D10278.id34458.diff
No OneTemporary

D10278.id34458.diff

diff --git a/native/redux/client-db-utils.js b/native/redux/client-db-utils.js
--- a/native/redux/client-db-utils.js
+++ b/native/redux/client-db-utils.js
@@ -9,8 +9,8 @@
} from 'lib/types/message-types.js';
import type {
ClientDBThreadInfo,
- LegacyRawThreadInfo,
- ThreadStoreThreadInfos,
+ RawThreadInfo,
+ RawThreadInfos,
} from 'lib/types/thread-types.js';
import {
translateClientDBMessageInfoToRawMessageInfo,
@@ -30,7 +30,7 @@
function updateClientDBThreadStoreThreadInfos(
state: AppState,
- migrationFunc: ThreadStoreThreadInfos => ThreadStoreThreadInfos,
+ migrationFunc: RawThreadInfos => RawThreadInfos,
): AppState {
// Get threads from SQLite `threads` table.
const clientDBThreadInfos = commCoreModule.getAllThreadsSync();
@@ -62,7 +62,7 @@
function createUpdateDBOpsForThreadStoreThreadInfos(
clientDBThreadInfos: $ReadOnlyArray<ClientDBThreadInfo>,
- migrationFunc: ThreadStoreThreadInfos => ThreadStoreThreadInfos,
+ migrationFunc: RawThreadInfos => RawThreadInfos,
): $ReadOnlyArray<ClientDBThreadStoreOperation> {
// Translate `ClientDBThreadInfo`s to `RawThreadInfo`s.
const rawThreadInfos = clientDBThreadInfos.map(
@@ -71,10 +71,7 @@
// Convert `rawThreadInfo`s to a map of `threadID` => `threadInfo`.
const threadIDToThreadInfo = rawThreadInfos.reduce(
- (
- acc: { [string]: LegacyRawThreadInfo },
- threadInfo: LegacyRawThreadInfo,
- ) => {
+ (acc: { [string]: RawThreadInfo }, threadInfo: RawThreadInfo) => {
acc[threadInfo.id] = threadInfo;
return acc;
},
@@ -82,11 +79,10 @@
);
// Apply `migrationFunc` to `threadInfo`s.
- const updatedThreadIDToThreadInfo: ThreadStoreThreadInfos =
- migrationFunc(threadIDToThreadInfo);
+ const updatedThreadIDToThreadInfo = migrationFunc(threadIDToThreadInfo);
// Convert the updated `threadInfo`s back into an array.
- const updatedRawThreadInfos: $ReadOnlyArray<LegacyRawThreadInfo> = values(
+ const updatedRawThreadInfos: $ReadOnlyArray<RawThreadInfo> = values(
updatedThreadIDToThreadInfo,
);

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 24, 5:50 AM (20 h, 26 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2573537
Default Alt Text
D10278.id34458.diff (2 KB)

Event Timeline