You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

actions.ts 756B

12345678910111213141516171819202122232425
  1. import { IStore } from '../app/types';
  2. import { analytics } from '../base/lib-jitsi-meet';
  3. import { SET_INITIAL_PERMANENT_PROPERTIES } from './actionTypes';
  4. /**
  5. * Updates a permanentProperty.
  6. *
  7. * @param {Object} properties - An object with properties to be updated.
  8. * @returns {Function}
  9. */
  10. export function setPermanentProperty(properties: Object) {
  11. return (dispatch: IStore['dispatch'], getState: IStore['getState']) => {
  12. const { isInitialized = false } = getState()['features/analytics'];
  13. if (isInitialized) {
  14. analytics.addPermanentProperties(properties);
  15. } else {
  16. dispatch({
  17. type: SET_INITIAL_PERMANENT_PROPERTIES,
  18. properties
  19. });
  20. }
  21. };
  22. }