Fix some things (thanks besties.house)
This commit is contained in:
parent
c6918b659b
commit
e0f1a59d86
3 changed files with 11 additions and 6 deletions
|
@ -31,7 +31,6 @@
|
|||
<input type="text" name="instance" id="instance" class="userinstance" />
|
||||
</span>
|
||||
<br />
|
||||
<br />
|
||||
<hr />
|
||||
<button id="submitwhoami_followers">Play (Followers)</button>
|
||||
<button id="submitwhoami_following">Play (Following)</button>
|
||||
|
|
|
@ -33,6 +33,8 @@ async function verify() {
|
|||
const instance = el_id_instance.value.replace(/@/gim, "");
|
||||
el_id_user.value = username;
|
||||
el_id_instance.value = instance;
|
||||
el_id_submitwhoamiFollowers.disabled = true;
|
||||
el_id_submitwhoamiFollowing.disabled = true;
|
||||
if (username.length < 1) return null;
|
||||
if (instance.length < 1) return null;
|
||||
let user_req;
|
||||
|
@ -42,6 +44,8 @@ async function verify() {
|
|||
return null;
|
||||
}
|
||||
const user_json = await user_req.json();
|
||||
el_id_submitwhoamiFollowers.disabled = false;
|
||||
el_id_submitwhoamiFollowing.disabled = false;
|
||||
if (user_req.ok) return {
|
||||
USER_ID: user_json.id,
|
||||
INSTANCE: instance
|
||||
|
@ -115,7 +119,7 @@ async function getFollowers(dontLoadNew = false) {
|
|||
let out;
|
||||
if (!dontLoadNew) {
|
||||
el_id_loadingfollowers.innerHTML = `Retrieving followers... Please wait.`;
|
||||
res = await fetch(`https://${game.INSTANCE}/api/v1/accounts/${game.USER_ID}/followers?limit=68${lastId.length > 0 ? `&max_id=${lastId}` : ""}`);
|
||||
res = await fetch(`https://${game.INSTANCE}/api/v1/accounts/${game.USER_ID}/followers${lastId.length > 0 ? `?max_id=${lastId}` : ""}`);
|
||||
out = await res.json();
|
||||
}
|
||||
el_id_submitfollowers.disabled = false;
|
||||
|
@ -135,11 +139,11 @@ async function getFollowers(dontLoadNew = false) {
|
|||
${renderNameHTML(cuser.display_name, cuser)}
|
||||
</a>
|
||||
</td>
|
||||
<td class="followers_namelabel">@${cuser.fqn}</td>
|
||||
<td class="followers_namelabel">@${cuser.fqn || cuser.acct}</td>
|
||||
</tr>`
|
||||
}, "");
|
||||
userList.push(...out.map(user => ({
|
||||
fqn: user.fqn,
|
||||
fqn: user.fqn || user.acct,
|
||||
avatar: user.avatar,
|
||||
bot: user.bot,
|
||||
created_at: user.created_at,
|
||||
|
|
|
@ -6,15 +6,17 @@
|
|||
}
|
||||
|
||||
.userinputbox {
|
||||
display: inline-block;
|
||||
border: var(--border-width) var(--border-style) var(--border-color);
|
||||
border-radius: var(--border-radius);
|
||||
padding-inline: 0.25em;
|
||||
padding-block: 0.25em;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.userinputbox * {
|
||||
/* .userinputbox * {
|
||||
vertical-align: 0%;
|
||||
}
|
||||
} */
|
||||
|
||||
#listfollowers, #listfollowing {
|
||||
display: inline-block;
|
||||
|
|
Loading…
Reference in a new issue