import { shell, ipcRenderer } from "electron"; function open_issue_tracker() { shell.openExternal("https://github.com/TeaSpeak/TeaClient/issues"); } function set_dump_error_flag(flag: boolean) { for(const node of document.getElementsByClassName("error-show") as HTMLCollectionOf) node.style.display = flag ? "block" : "none"; for(const node of document.getElementsByClassName("error-hide") as HTMLCollectionOf) node.style.display = flag ? "none" : "block"; } function set_dump_url(url: string) { for(const crash_path_node of document.getElementsByClassName("crash-dump-directory") as HTMLCollectionOf) { crash_path_node.textContent = url; crash_path_node.onclick = () => shell.showItemInFolder(url); } set_dump_error_flag(false); } function set_dump_error(error: string) { set_dump_error_flag(true); for(const node of document.getElementsByClassName("crash-dump-error") as HTMLCollectionOf) node.textContent = error; } ipcRenderer.on('dump-url', (event, url) => set_dump_url(url)); ipcRenderer.on('dump-error', (event, error) => set_dump_error(error));