diff --git a/modules/crash_handler/index.ts b/modules/crash_handler/index.ts index 785d88e..f6b1b59 100644 --- a/modules/crash_handler/index.ts +++ b/modules/crash_handler/index.ts @@ -1,3 +1,5 @@ +import {main_window} from "../core/main_window"; + require("../shared/require").setup_require(module); import {app, BrowserWindow, remote} from "electron"; import * as path from "path"; @@ -55,6 +57,8 @@ export function handle_crash_callback(args: string[]) { javascript: true } }); + crash_window.on('focus', event => crash_window.flashFrame(false)); + crash_window.setMenu(null); crash_window.loadFile(path.join(path.dirname(module.filename), "ui", "index.html")); crash_window.on('ready-to-show', () => { @@ -65,13 +69,14 @@ export function handle_crash_callback(args: string[]) { else crash_window.webContents.send('dump-url', crash_file); crash_window.show(); + crash_window.setProgressBar(1, {mode: "error"}); + crash_window.flashFrame(true); }); app.on('window-all-closed', () => { process.exit(0); }); - - crash_window.focus(); }); + app.commandLine.appendSwitch('autoplay-policy', 'no-user-gesture-required'); } export const handler = require( "teaclient_crash_handler"); diff --git a/modules/crash_handler/ui/index.ts b/modules/crash_handler/ui/index.ts index 205f84e..18553ef 100644 --- a/modules/crash_handler/ui/index.ts +++ b/modules/crash_handler/ui/index.ts @@ -4,6 +4,16 @@ function open_issue_tracker() { shell.openExternal("https://github.com/TeaSpeak/TeaClient/issues"); } +function play_sound() { + // Replaying sound from https://freesound.org/people/dersuperanton/sounds/435883/ + const node = document.createElement("audio"); + node.src = "./oh-oh.wav"; + node.volume = 1; + document.body.append(node); + node.play(); +} +play_sound(); + function set_dump_error_flag(flag: boolean) { for(const node of document.getElementsByClassName("error-show") as HTMLCollectionOf) node.style.display = flag ? "block" : "none"; diff --git a/modules/crash_handler/ui/oh-oh.wav b/modules/crash_handler/ui/oh-oh.wav new file mode 100644 index 0000000..6b00f6c Binary files /dev/null and b/modules/crash_handler/ui/oh-oh.wav differ diff --git a/modules/renderer/index.ts b/modules/renderer/index.ts index 9d1bd52..c0b7859 100644 --- a/modules/renderer/index.ts +++ b/modules/renderer/index.ts @@ -267,5 +267,5 @@ const load_modules = async () => { console.log("Loaded native extensions"); remote.getCurrentWindow().on('focus', () => main_window.flashFrame(false)); - remote.getCurrentWindow().flashFrame(true); + // remote.getCurrentWindow().flashFrame(true); }; \ No newline at end of file