signal-desktop/ts/util/deleteAllLogs.ts

16 lines
474 B
TypeScript
Raw Normal View History

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
import { ipcRenderer } from 'electron';
import pTimeout from 'p-timeout';
import { beforeRestart } from '../logging/set_up_renderer_logging';
import * as durations from './durations';
export function deleteAllLogs(): Promise<void> {
// Restart logging again when the file stream close
beforeRestart();
return pTimeout(ipcRenderer.invoke('delete-all-logs'), 5 * durations.SECOND);
}