Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

Eliminate yarn test spam #1024

Merged
merged 13 commits into from
Apr 3, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
work around UnhandledPromiseRejectionWarning errors from localforage
  • Loading branch information
lieut-data committed Mar 28, 2018
commit d548f3d4d0720bca6fea1aa7ba7e282a6851aa73
7 changes: 6 additions & 1 deletion store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export default function configureStore(initialState) {
const storage = localforage;
const KEY_PREFIX = 'reduxPersist:';

localforage.ready(() => {
localforage.ready().then(() => {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See localForage/localForage#722 for more details.

const persistor = persistStore(store, {storage, keyPrefix: KEY_PREFIX, ...options}, () => {
store.dispatch({
type: General.STORE_REHYDRATION_COMPLETE,
Expand Down Expand Up @@ -135,6 +135,11 @@ export default function configureStore(initialState) {
});
}
});
}).catch((error) => {
store.dispatch({
type: General.STORE_REHYDRATION_FAILED,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've got a pending PR to add this constant to mattermost-redux... if we think we need it. No one is going to handle it right now. Feedback requested!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if I prefer simply a log message for now. Anyway, I think it must be in the webapp redux flow, not in the mattermost-redux one. Because all the storage thing is handle independently from RN app and webapp.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll move the constant locally -- the log message would defeat the point of this change, at present ;P

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hahaha, you are completely right, I'm an idiot :)

error,
});
});
},
persistOptions: {
Expand Down