mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2026-05-22 06:27:48 +00:00
Works only for XHR requests, which is the only network request mobile performs (WebRTC traffic aside). The fetch API is implemented on top of XHR, so that's covered too. Requests are kept in the redux store until they complete, at which point they are removed.
26 lines
631 B
JavaScript
26 lines
631 B
JavaScript
import { APP_WILL_MOUNT, APP_WILL_UNMOUNT } from '../../app';
|
|
import { MiddlewareRegistry } from '../../base/redux';
|
|
|
|
import { startNetInterception, stopNetInterception } from './functions';
|
|
|
|
/**
|
|
* Middleware which captures app startup and conference actions in order to
|
|
* clear the image cache.
|
|
*
|
|
* @returns {Function}
|
|
*/
|
|
MiddlewareRegistry.register(store => next => action => {
|
|
const result = next(action);
|
|
|
|
switch (action.type) {
|
|
case APP_WILL_MOUNT:
|
|
startNetInterception(store);
|
|
break;
|
|
case APP_WILL_UNMOUNT:
|
|
stopNetInterception(store);
|
|
break;
|
|
}
|
|
|
|
return result;
|
|
});
|