Fix: Support both numeric and hash song IDs for leaderboard
This commit is contained in:
@@ -958,11 +958,12 @@ class Scoresheet {
|
||||
}
|
||||
|
||||
submitToLeaderboard(songId, difficulty, scoreObj) {
|
||||
// Only submit if user is logged in and song has valid numeric ID
|
||||
if (!account.loggedIn || !songId || isNaN(parseInt(songId))) {
|
||||
// Only submit if user is logged in and song has an ID
|
||||
if (!account.loggedIn || !songId) {
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
var self = this
|
||||
loader.getCsrfToken().then(token => {
|
||||
var request = new XMLHttpRequest()
|
||||
@@ -984,7 +985,7 @@ class Scoresheet {
|
||||
}
|
||||
|
||||
request.send(JSON.stringify({
|
||||
song_id: parseInt(songId),
|
||||
song_id: songId,
|
||||
difficulty: difficulty,
|
||||
score: scoreObj
|
||||
}))
|
||||
|
||||
Reference in New Issue
Block a user