Compare commits

..

No commits in common. "c2a75319dcd5497e097800bfb3e44116574f7f06" and "1b8dfbad0314a59dc695d8b97af7a5c80641841c" have entirely different histories.

3 changed files with 10 additions and 24 deletions

22
app.js
View File

@ -22,13 +22,6 @@ const run = () => {
mainWindow = createWindow();
mainWindow.on('show', async () => {
const osuPath = await config.get("osuPath", "");
const isValid = await osuUtil.isValidOsuFolder(osuPath);
if (osuPath.trim == "" || !isValid) {
mainWindow.webContents.send('status_update', {
type: "missing-folder"
})
return;
}
if (fs.existsSync(osuPath)) {
tempOsuPath = osuPath;
const osuConfig = await osuUtil.getLatestConfig(tempOsuPath);
@ -41,17 +34,14 @@ const run = () => {
const releaseFiles = await osuUtil.getUpdateFiles(releaseStream);
const filesToDownload = await osuUtil.filesThatNeedUpdate(tempOsuPath, releaseFiles);
// const downloadTask = await osuUtil.downloadUpdateFiles(osuPath, filesToDownload);
// downloadTask.on('completed', () => {
// console.log("done!");
// });
/* const downloadTask = await osuUtil.downloadUpdateFiles(osuPath, filesToDownload);
downloadTask.on('completed', () => {
console.log("done!");
}); */
mainWindow.webContents.send('status_update', {
type: filesToDownload.length > 0 ? "update-available" : "up-to-date"
})
} else
mainWindow.webContents.send('status_update', {
type: "missing-folder"
})
}
})
app.on('activate', function () {
if (BrowserWindow.getAllWindows().length === 0) mainWindow = createWindow();
@ -66,7 +56,7 @@ const run = () => {
if (yes.filePaths.length <= 0)
return undefined;
const folderPath = yes.filePaths[0];
const validOsuDir = await osuUtil.isValidOsuFolder(folderPath);
const validOsuDir = osuUtil.isValidOsuFolder(folderPath);
if (validOsuDir) await config.set("osuPath", folderPath);

View File

@ -7,6 +7,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" type="image/png" href="../assets/logo.png" />
<link href="../assets/mdb.min.css" rel="stylesheet" />
<link href="../assets/sweetalert2.dark.css" rel="stylesheet" />
<style>
* {
user-select: none;

View File

@ -22,16 +22,16 @@ window.addEventListener('DOMContentLoaded', () => {
if (success) {
Swal.fire({
title: 'Success!',
text: 'osu! folder set.',
text: 'osu! folder set!',
icon: 'success',
confirmButtonText: 'Cool'
})
} else {
Swal.fire({
title: 'Uh oh!',
text: 'The selected folder is not a osu! directory.',
text: 'failed to set osu! folder.',
icon: 'error',
confirmButtonText: 'Oops.. my bad!'
confirmButtonText: 'Cool'
})
}
});
@ -46,11 +46,6 @@ window.addEventListener('DOMContentLoaded', () => {
$("#launch-btn").attr('disabled', false);
$('#launch-btn').html('Update');
break;
case "missing-folder":
$('#launch-btn').html('Please set your osu folder!');
}
})
// workaround for the dark theme
$('head').append($('<link href="../assets/sweetalert2.dark.css" rel="stylesheet" />'));
})