Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
//
webFrame.setLayoutZoomLevelLimits (settings.minZoomLevel, settings.maxZoomLevel);
//
function generateTitle (unitName)
{
let title = settings.window.titleTemplate
.replace ("{{app}}", appName)
.replace ("{{unit}}", unitName);
let zoomFactor = Math.round (webFrame.getZoomFactor () * 100);
return title + ((zoomFactor !== 100) ? settings.window.zoomSuffixTemplate.replace ("{{zoom}}", zoomFactor) : "");
}
//
if (settings.unitsMenu)
{
ipcRenderer.send ('update-units-menu', [ ]);
}
//
// Collect units information
let categories = { };
let categoryNames = [ ];
let unitNames = [ ];
let unitElements = { };
let unitImports = [ ];
//
let unitsDirname = path.join (__dirname, 'units');
let unitsFilenames = fs.readdirSync (unitsDirname);
//
let unitFilenames = [ ];
//
for (let unitsFilename of unitsFilenames)
{
function validateField (field, errLabel) {
var MPregex = /^(?=.*[A-Za-z])(?=.*\d)(?=.*[$@$!%*#?&])[A-Za-z\d$@$!%*#?&]{8,}$/g,
MPel = $(`input#${field + 'Input'}`)
const masterpass = MPel.val()
if (MPregex.test(masterpass)) {
errLabel.hide()
MPel.val('')
ipcRenderer.send(field, masterpass)
} else if (!masterpass) {
errLabel.text(responses.empty)
errLabel.show()
MPel.val('')
} else {
errLabel.text(responses.invalid)
errLabel.show()
MPel.val('')
}
}
fs.pathExists(folder, (err, exists) => {
if (err) {
console.error(err);
Sentry.captureException(err);
ipc.send('capture-folder-upload-error', folder, userId, spectator, err);
if (uploadTries < 5) {
setTimeout(uploadFolder, 3000);
} else {
deleteFolder();
}
return;
} else if (!exists) {
ipc.send('capture-folder-upload-finished', folder, userId, spectator);
window.close();
return;
}
const folderName = folder.match(/[\\/]([^\\/]+)$/)[1];
const uploadKey = `fortnite/packed/${userId}/${folderName}.tar.gz`;
console.log('pre zip');
const passThrough = new PassThrough();
tar.create({ gzip: true }, [folder]).pipe(passThrough);
private onPlay = () => {
log.info("Audio service :: Playing.");
this.playing.next(true);
ipc.send("media-play");
}
openGoogleConsentScreen = event => {
ipcRenderer.send("open-google-oauth");
};
handleGoogleCallback = (event, accessToken) => {
dispatch (redoAccelerator ())
})
localShortcut.register (currentWindow, "CmdOrCtrl+Shift+Z", () => {
dispatch (redoAccelerator ())
})
localShortcut.register (currentWindow, "CmdOrCtrl+W", () => {
dispatch (backAccelerator ())
})
localShortcut.register (currentWindow, "CmdOrCtrl+O", () => {
dispatch (openSettingsAccelerator ())
})
ipcRenderer.send ("loading-done")
return Unit
})
.catch (() => undefined)
document.getElementById("streamdeckSave").addEventListener("click", () => {
ipcRenderer.send("streamdeck-save", "save clicked!");
});
_updateBadges = () => {
ipcRenderer.send('showTray', this.props.widgetBadge, this.props.desktopAppBadgeCount)
}
files.forEach((file) => {
const filePath = file.path;
const ext = path.extname(filePath).substring(1);
if (validator.isIn(ext, subtitleTypes)) {
ipcRenderer.send('ask-open-file', filePath);
} else if (validator.isIn(ext, videoTypes)) {
ipcRenderer.send('ask-open-video', filePath);
}
});
};