fix: use userID instead of username for great divide stats request
This commit is contained in:
parent
a71b0f26be
commit
27a8986272
2 changed files with 2 additions and 2 deletions
|
|
@ -105,7 +105,7 @@ chrome.runtime.onMessage.addListener(async function (request, sender, sendRespon
|
||||||
if (request.action === 'reload') {
|
if (request.action === 'reload') {
|
||||||
chrome.runtime.reload();
|
chrome.runtime.reload();
|
||||||
} else if (request.action === 'greatdivide_stats') {
|
} else if (request.action === 'greatdivide_stats') {
|
||||||
const Statistics = (await (await fetch('https://stats.silly.mom/player_stats?username=' + request.username)).json()).results
|
const Statistics = (await (await fetch('https://stats.silly.mom/player_stats?id=' + request.userID)).json()).results
|
||||||
|
|
||||||
chrome.tabs.query({ active: true, currentWindow: true }, function(tabs){
|
chrome.tabs.query({ active: true, currentWindow: true }, function(tabs){
|
||||||
chrome.scripting
|
chrome.scripting
|
||||||
|
|
|
||||||
|
|
@ -119,7 +119,7 @@ async function UserStatsTab() {
|
||||||
if (Fetched === false) {
|
if (Fetched === false) {
|
||||||
chrome.runtime.sendMessage({
|
chrome.runtime.sendMessage({
|
||||||
action: "greatdivide_stats",
|
action: "greatdivide_stats",
|
||||||
username: window.location.pathname.split('/')[2]
|
userID: document.querySelector('.dropdown-item.text-danger[href^="/report"]').getAttribute('href').split('?')[0].split('/')[3]
|
||||||
});
|
});
|
||||||
Fetched = true
|
Fetched = true
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Reference in a new issue