* Patch react-native-image-picker to allow selecting video
* Improve patch
* Fix Attaching a Photo capture
Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
* Fix isDateLine function to check for null and undefined
* use optional chaining instead
Co-Authored-By: Amit Uttam <changingrainbows@gmail.com>
Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
Co-authored-by: Amit Uttam <changingrainbows@gmail.com>
* Remove redux-offline and configure redux-persist
* Fix typo
* Fix configure store
* Upgrade to redux-persist 6.0.0
* Add migration from redux-persist v4 to v6
* Replace AsyncStorage with MMKVStorage to boost storage speed
* Mock RNFastStorage
* Fix reactions test
* Fix clearing the store on logout
* Remove the need for LOGOUT_SUCCESS
* No need to pass persistConfig to middlewares()
* Remove unused imports
* Export connection
Accidentally removed this export.
* Add batch action name
Co-Authored-By: Elias Nahum <nahumhbl@gmail.com>
* Add batch action name
Co-Authored-By: Elias Nahum <nahumhbl@gmail.com>
* Add batch action name
Co-Authored-By: Elias Nahum <nahumhbl@gmail.com>
* Add batch action name
Co-Authored-By: Elias Nahum <nahumhbl@gmail.com>
* Fix delete post
* Fix leave channel
Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
MM-23490 Save state to file via async middleware vs store subscription
Currently for iOS, a subset of store state is saved to an on-device file, so that the Share Extension can have access to information it needs (teams and channels) to function.
This file saving would happen via a store subscription which triggers a file save for every dispatched action. By moving this logic to a middleware function, when this function gets invoked is now limited to a configurable set of action dispatches. (e.g. `LOGIN`, `CONNECTION_CHANGED`, `WEBSOCKET_SUCCESS`), etc.
MM-23493 Move app cache purge from store subscription to middleware (#4069)
* MM-23493 Move app cache purge from store subscription to middleware
This commit exposes persistence configuration as a static reference, so that cache purging can be invoked on demand anywhere else in the codebase.
While middleware still may not be the best spot for this singular "action", existing functionality (reacting to `OFFLINE_STORE_PURGE`) is maintained.
The change also removes the need for `state.views.root.purge` to exist in the state tree.
* PR feedback: Inject config dependency for purging app cache
Previously, `middleware` imported the config back from `store` (i.e. cyclic import).
* PR feedback: No need to export config, now that it's passed as argument
* Fix tests after refactoring middleware call from array -> function
* PR feedback: Let parent continue to pass down initial store state
* Port WebSocket from mm-redux and batch actions
* Update mm-redux and fix tests
* Change action name
* Naming batch actions
* Fix unit tests
* Dispatch connection change only if its different
* Remove comment
* Add Lint to TypeScript and fix linting errors
* Add WebSocket Unit Tests
* Revert from unwanted RN 0.62
MM-23490 Save state to file via async middleware vs store subscription
Currently for iOS, a subset of store state is saved to an on-device file, so that the Share Extension can have access to information it needs (teams and channels) to function.
This file saving would happen via a store subscription which triggers a file save for every dispatched action. By moving this logic to a middleware function, when this function gets invoked is now limited to a configurable set of action dispatches. (e.g. `LOGIN`, `CONNECTION_CHANGED`, `WEBSOCKET_SUCCESS`), etc.
MM-23493 Move app cache purge from store subscription to middleware (#4069)
* MM-23493 Move app cache purge from store subscription to middleware
This commit exposes persistence configuration as a static reference, so that cache purging can be invoked on demand anywhere else in the codebase.
While middleware still may not be the best spot for this singular "action", existing functionality (reacting to `OFFLINE_STORE_PURGE`) is maintained.
The change also removes the need for `state.views.root.purge` to exist in the state tree.
* PR feedback: Inject config dependency for purging app cache
Previously, `middleware` imported the config back from `store` (i.e. cyclic import).
* PR feedback: No need to export config, now that it's passed as argument
* Fix tests after refactoring middleware call from array -> function
* PR feedback: Let parent continue to pass down initial store state
* Ensure postProps is not null/undefined
* Disable camelcase check
Co-authored-by: Miguel Alatzar <this.migbot@gmail.com>
Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com>