Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Emitter.on('error', (event, details) => {
username.then((name) => {
window.showToast(TranslationProvider.query('message-uncaught-error'), false,
TranslationProvider.query('message-uncaught-error-button'), '#E53935',
(buttonEvent, toast) => {
const title = `Uncaught Exception: ${details.error.message.split(/\n/g)[0].substring(0, 100)}`;
const body = `
An uncaught exception was reported. %0A
%23%23%23%23 Info:%0A
**OS:** ${process.platform}%0A
**Arch:** ${process.arch}%0A
**GPMDP Version:** ${require('../../../../package.json').version}%0A
**Time:** ${new Date()}%0A
%0A
%23%23%23%23 Error:%0A
*${details.error.message.split(/\n/g)[0].substring(0, 100).replace(new RegExp(name, 'g'), '')}*%0A
\`\`\`js%0A
${details.error.stack.replace(/(?:\r\n|\r|\n)/g, '%0A').substring(0, 1200).replace(new RegExp(name, 'g'), '')}
<section style="opacity:0;" id="keyboard">
</section>`;
window.keyboard = new Keyboard({
layout: path.join(keyboardsDir, settings.keyboard+".json"),
container: "keyboard"
});
await _delay(10);
document.getElementById("main_shell").setAttribute("style", "");
await _delay(270);
let greeter = document.getElementById("main_shell_greeting");
require("username")().then(user => {
greeter.innerHTML += `Welcome back, <em>${user}</em>`;
}).catch(() => {
greeter.innerHTML += "Welcome back";
});
greeter.setAttribute("style", "opacity: 1;");
document.getElementById("filesystem").setAttribute("style", "");
document.getElementById("keyboard").setAttribute("style", "");
document.getElementById("keyboard").setAttribute("class", "animation_state_1");
window.audioManager.keyboard.play();
await _delay(100);
document.getElementById("keyboard").setAttribute("class", "animation_state_1 animation_state_2");
await _delay(1000);