Closed hucario closed 3 years ago
That's alright. I may need to cherrypick them to make it merge well though.
It's happening because of the squash&merge i did a few commits ago. Your repo is out of date with mine. You may need to do a force
to get it back in sync.
pushed a commit that should fix #76 - edits partnerLogin to read this:
async function partnerLogin() {
if (localStorage.username !== "" && localStorage.password !== "") {
let request = JSON.stringify({
"username": "android",
"password": "AC7IBG09A3DTSYM4R41UJWL07VLN8JI7",
"version": "5",
"deviceModel": "android-generic",
"includeUrls": true
});
let response = await sendRequest(true, false, "auth.partnerLogin", request);
var b = stringToBytes(decrypt(response.result.syncTime));
// skip 4 bytes of garbage
var s = "", i;
for (i = 4; i < b.length; i++) {
s += String.fromCharCode(b[i]);
}
syncTime = parseInt(s);
clientStartTime = parseInt((new Date().getTime() + "").substr(0, 10));
// if it didn't work we wouldn't be here so this wouldn't run. so, we're here and the login succeeded
dontRetryPartnerLogin = false;
return await userLogin(response);
}
}
wait, I'm an idiot and I need to move that line to userLogin
. Whoops
alright now it reads this in userLogin
:
let res = await sendRequest(true, true, parameters, request);
if (res.stat == "fail") {
return "uncool credentials";
}
// we good apparently
dontRetryPartnerLogin = false;
explanation of previous commit:
because I made the handler an async function it would actually return a Promise instead of false
so instead I made it a synchronous function that executes an async function but doesn't wait and just returns false:
async function doesntWorkAsHandler() {
await etcetera();
goToPlayerPaneOrSomething();
return false;
} // returns a Promise that resolves to false
function doesWork() {
(async() => {
await etcetera();
goToPlayerPaneOrSomething();
})();
return false;
} // actually returns false
*previous commit doesn't exist, please don't realize I don't test nearly as much as I should
going to hold off on these for now.
LMK when we're good to merge
https://github.com/pvrs12/Anesidora/pull/79 without any extras. will add more as you do 👉😎👉
think I'm ready now unless someone opens another issue
Fantastic! I'll be doing it under #79
oh alright it's just got all my other commits too
I only wanted those two latest ones but whatever