diff --git a/native/data/sqlite-context-provider.js b/native/data/sqlite-context-provider.js --- a/native/data/sqlite-context-provider.js +++ b/native/data/sqlite-context-provider.js @@ -38,7 +38,10 @@ } (async () => { try { - const threads = await commCoreModule.getAllThreads(); + const [threads, messages] = await Promise.all([ + commCoreModule.getAllThreads(), + commCoreModule.getAllMessages(), + ]); const threadInfosFromDB = convertClientDBThreadInfosToRawThreadInfos( threads, ); @@ -46,7 +49,6 @@ type: setThreadStoreActionType, payload: { threadInfos: threadInfosFromDB }, }); - const messages = await commCoreModule.getAllMessages(); dispatch({ type: setMessageStoreMessages, payload: messages,