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