2022-09-27 07:42:30 +00:00
|
|
|
import { IStore } from '../app/types';
|
2020-10-02 13:20:24 +00:00
|
|
|
import getRoomName from '../base/config/getRoomName';
|
|
|
|
import { downloadJSON } from '../base/util/downloadJSON';
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Create an action for saving the conference logs.
|
|
|
|
*
|
|
|
|
* @returns {Function}
|
|
|
|
*/
|
|
|
|
export function saveLogs() {
|
2022-09-27 07:42:30 +00:00
|
|
|
return (dispatch: IStore['dispatch'], getState: IStore['getState']) => {
|
2020-10-02 13:20:24 +00:00
|
|
|
|
2022-09-27 07:42:30 +00:00
|
|
|
const logs = getState()['features/base/connection'].connection?.getLogs();
|
2020-10-02 13:20:24 +00:00
|
|
|
const roomName = getRoomName() || '';
|
|
|
|
|
2022-09-27 07:42:30 +00:00
|
|
|
downloadJSON(logs ?? {}, `meetlog-${roomName}.json`);
|
2020-10-02 13:20:24 +00:00
|
|
|
};
|
|
|
|
}
|