2023-01-03 11:55:46 -08:00
|
|
|
// Copyright 2018 Signal Messenger, LLC
|
2020-10-30 15:34:04 -05:00
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2021-09-20 20:25:29 -04:00
|
|
|
import { ipcRenderer } from 'electron';
|
2022-05-09 18:12:04 -07:00
|
|
|
import pTimeout from 'p-timeout';
|
2018-03-07 16:16:03 -08:00
|
|
|
|
2021-09-20 20:25:29 -04:00
|
|
|
import { beforeRestart } from '../logging/set_up_renderer_logging';
|
2022-05-09 18:12:04 -07:00
|
|
|
import * as durations from './durations';
|
2021-05-13 13:54:54 -07:00
|
|
|
|
2021-09-20 20:25:29 -04:00
|
|
|
export function deleteAllLogs(): Promise<void> {
|
2022-05-09 18:12:04 -07:00
|
|
|
// Restart logging again when the file stream close
|
|
|
|
beforeRestart();
|
2021-05-13 13:54:54 -07:00
|
|
|
|
2022-05-09 18:12:04 -07:00
|
|
|
return pTimeout(ipcRenderer.invoke('delete-all-logs'), 5 * durations.SECOND);
|
2018-03-07 16:16:03 -08:00
|
|
|
}
|