Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3352419
D10278.id34458.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D10278.id34458.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D10278: [native] Update `client-db-utils` to accomodate `RawThreadInfos`
Attached
Detach File
Event Timeline
Log In to Comment