mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-04-18 23:49:20 +01:00
Rename files
This commit is contained in:
32
ts/windows/debuglog/preload.preload.ts
Normal file
32
ts/windows/debuglog/preload.preload.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
// Copyright 2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { contextBridge, ipcRenderer } from 'electron';
|
||||
import { MinimalSignalContext } from '../minimalContext.preload.js';
|
||||
|
||||
function downloadLog(logText: string) {
|
||||
ipcRenderer.send('show-debug-log-save-dialog', logText);
|
||||
}
|
||||
|
||||
async function fetchLogs() {
|
||||
const data = await ipcRenderer.invoke('fetch-log');
|
||||
return ipcRenderer.invoke(
|
||||
'DebugLogs.getLogs',
|
||||
data,
|
||||
window.navigator.userAgent
|
||||
);
|
||||
}
|
||||
|
||||
function uploadLogs(logs: string) {
|
||||
return ipcRenderer.invoke('DebugLogs.upload', logs);
|
||||
}
|
||||
|
||||
const Signal = {
|
||||
DebugLogWindowProps: {
|
||||
downloadLog,
|
||||
fetchLogs,
|
||||
uploadLogs,
|
||||
},
|
||||
};
|
||||
contextBridge.exposeInMainWorld('Signal', Signal);
|
||||
contextBridge.exposeInMainWorld('SignalContext', MinimalSignalContext);
|
||||
Reference in New Issue
Block a user