mirror of
https://github.com/MewoLab/AquaDX.git
synced 2026-02-09 07:17:26 +08:00
[+] Show aqua net pfp instead of in-game pfp
This commit is contained in:
@@ -12,7 +12,7 @@ export interface Card {
|
||||
ghost: boolean
|
||||
}
|
||||
|
||||
export interface UserMe {
|
||||
export interface AquaNetUser {
|
||||
username: string
|
||||
email: string
|
||||
displayName: string
|
||||
@@ -80,6 +80,7 @@ export interface RankCount {
|
||||
export interface GenericGameSummary {
|
||||
name: string
|
||||
iconId: number
|
||||
aquaUser?: AquaNetUser
|
||||
serverRank: number
|
||||
accuracy: number
|
||||
rating: number
|
||||
|
||||
@@ -6,7 +6,7 @@ import type {
|
||||
GenericGameSummary,
|
||||
GenericRanking,
|
||||
TrendEntry,
|
||||
UserMe
|
||||
AquaNetUser
|
||||
} from "./generalTypes";
|
||||
import type { GameName } from "./scoring";
|
||||
|
||||
@@ -111,7 +111,7 @@ export const USER = {
|
||||
login,
|
||||
confirmEmail: (token: string) =>
|
||||
post('/api/v2/user/confirm-email', { token }),
|
||||
me: (): Promise<UserMe> => {
|
||||
me: (): Promise<AquaNetUser> => {
|
||||
ensureLoggedIn()
|
||||
return post('/api/v2/user/me', {})
|
||||
},
|
||||
|
||||
@@ -16,7 +16,7 @@ import CalHeatmap from 'cal-heatmap'
|
||||
// @ts-expect-error Cal-heatmap does not have proper types
|
||||
import CalTooltip from 'cal-heatmap/plugins/Tooltip'
|
||||
import { AQUA_HOST, DEFAULT_PFP } from "./config";
|
||||
import type { UserMe } from "./generalTypes";
|
||||
import type { AquaNetUser } from "./generalTypes";
|
||||
|
||||
export function title(t: string) {
|
||||
document.title = `AquaNet - ${t}`
|
||||
@@ -154,7 +154,7 @@ export function tooltip(element: HTMLElement, params: { text: string } | string)
|
||||
}
|
||||
}
|
||||
|
||||
export function pfp(node: HTMLImageElement, me: UserMe) {
|
||||
node.src = me.profilePicture ? `${AQUA_HOST}/uploads/net/portrait/${me.profilePicture}` : DEFAULT_PFP
|
||||
export function pfp(node: HTMLImageElement, me?: AquaNetUser) {
|
||||
node.src = me?.profilePicture ? `${AQUA_HOST}/uploads/net/portrait/${me.profilePicture}` : DEFAULT_PFP
|
||||
node.onerror = e => pfpNotFound(e as Event)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user