Skip to content

Commit

Permalink
Merge pull request #149 from StarGazer1258/beta
Browse files Browse the repository at this point in the history
Merge 2.6.2-beta to stable
  • Loading branch information
StarGazer1258 authored Jan 12, 2020
2 parents 6b52945 + 6520700 commit 2d3e0c5
Show file tree
Hide file tree
Showing 32 changed files with 445 additions and 170 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "beatdrop",
"description": "A desktop app for downloading Beat Saber songs.",
"author": "Nathaniel Johns (StarGazer1258)",
"version": "2.5.9",
"version": "2.6.2-beta",
"private": false,
"license": "CC-BY-NC-SA-4.0",
"repository": {
Expand Down
9 changes: 3 additions & 6 deletions public/electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ let launchEvents = {
details: [],
install: [],
uninstall: []
}
},
files: []
}

ipcMain.on('launch-events', (_, event, message) => {
Expand Down Expand Up @@ -155,7 +156,7 @@ function handleArgs(argv, sendImmediately) {
// handle files
const args = argv.filter((_, i) => !(i < (isDev ? 2 : 1)))
const { ext } = path.parse(args[0])
return handleFiles(args[0], ext);
launchEvents.files.push({ file: args[0], ext })
}

function handleBeatdrop(argv, sendImmediately){
Expand Down Expand Up @@ -220,10 +221,6 @@ function handleBeatdrop(argv, sendImmediately){
}
}

function handleFiles(path, ext){
mainWindow.webContents.send('file-open', path, ext);
}

function createWindow() {
mainWindow = new BrowserWindow({
width: 1080,
Expand Down
7 changes: 7 additions & 0 deletions src/actions/appActions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { RESET_APP } from "./types"

export const resetApp = () => dispatch => {
dispatch({
type: RESET_APP
})
}
6 changes: 3 additions & 3 deletions src/actions/detailsActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const loadDetailsFromFile = file => (dispatch, getState) => {
type: SET_DETAILS_LOADING,
payload: true
})
setView(SONG_DETAILS)(dispatch)
setView(SONG_DETAILS)(dispatch, getState)
fs.readFile(file, 'UTF-8', (err, data) => {
if(err) return
let details = JSON.parse(data)
Expand Down Expand Up @@ -50,15 +50,15 @@ export const loadDetailsFromFile = file => (dispatch, getState) => {
* Loads and presents the details page for a song from a key.
* @param {string} key The key of the song
*/
export const loadDetailsFromKey = key => dispatch => {
export const loadDetailsFromKey = key => (dispatch, getState) => {
dispatch({
type: CLEAR_DETAILS
})
dispatch({
type: SET_DETAILS_LOADING,
payload: true
})
setView(SONG_DETAILS)(dispatch)
setView(SONG_DETAILS)(dispatch, getState)
if((/^[a-f0-9]+$/).test(key)) {
fetch(`https://beatsaver.com/api/maps/detail/${key}`)
.then(res => {
Expand Down
Loading

0 comments on commit 2d3e0c5

Please sign in to comment.