2022-03-30 13:54:03 +00:00
|
|
|
import { GiphySDK } from '@giphy/react-native-sdk';
|
|
|
|
|
2022-09-29 11:45:34 +00:00
|
|
|
import StateListenerRegistry from '../base/redux/StateListenerRegistry';
|
2022-03-30 13:54:03 +00:00
|
|
|
|
2022-10-21 11:09:15 +00:00
|
|
|
import { isGifEnabled } from './function.any';
|
2022-03-30 13:54:03 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Listens for changes in the number of participants to calculate the dimensions of the tile view grid and the tiles.
|
|
|
|
*/
|
|
|
|
StateListenerRegistry.register(
|
|
|
|
/* selector */ state => state['features/base/config']?.giphy,
|
|
|
|
/* listener */ (_, store) => {
|
|
|
|
const state = store.getState();
|
|
|
|
|
|
|
|
if (isGifEnabled(state)) {
|
2022-09-29 11:45:34 +00:00
|
|
|
GiphySDK.configure({ apiKey: state['features/base/config'].giphy?.sdkKey ?? '' });
|
2022-03-30 13:54:03 +00:00
|
|
|
}
|
|
|
|
}, {
|
|
|
|
deepEquals: true
|
|
|
|
});
|