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 @@ -1,6 +1,7 @@ // @flow import * as React from 'react'; +import { Alert } from 'react-native'; import { useDispatch } from 'react-redux'; import { setMessageStoreMessages } from 'lib/actions/message-actions.js'; @@ -46,15 +47,24 @@ type: setMessageStoreMessages, payload: messages, }); - } catch { - await fetchNewCookieFromNativeCredentials( - dispatch, - cookie, - urlPrefix, - loginActionSources.sqliteLoadFailure, - ); - } finally { setStoreLoaded(true); + } catch (setStoreException) { + Alert.alert( + `Error setting threadStore or messageStore: ${setStoreException}`, + ); + try { + await fetchNewCookieFromNativeCredentials( + dispatch, + cookie, + urlPrefix, + loginActionSources.sqliteLoadFailure, + ); + setStoreLoaded(true); + } catch (fetchCookieException) { + Alert.alert( + `Error fetching new cookie from native credentials: ${fetchCookieException}`, + ); + } } })(); }, [storeLoaded, urlPrefix, rehydrateConcluded, cookie, dispatch]);