refactor(geoip): reconcile geoip system (#31)

This commit is contained in:
hampus-fluxer
2026-01-05 23:19:05 +01:00
committed by GitHub
parent 5d047b2856
commit 2e007b5076
86 changed files with 982 additions and 2648 deletions

View File

@@ -97,6 +97,9 @@ const AuthSession: React.FC<AuthSessionProps> = observer(
const platformLabel =
authSession.clientPlatform === 'Fluxer Desktop' ? t`Fluxer Desktop` : authSession.clientPlatform;
const hasLocation = Boolean(authSession.clientLocation);
const locationRowVisible = hasLocation || !isCurrent;
return (
<div
className={clsx(styles.authSession, selectionMode && !isCurrent && styles.authSessionSelectable)}
@@ -114,17 +117,17 @@ const AuthSession: React.FC<AuthSessionProps> = observer(
{platformLabel}
</span>
<div className={styles.authSessionLocation}>
<span className={styles.locationText}>{authSession.clientLocation}</span>
{!isCurrent && (
<>
<span aria-hidden className={styles.locationSeparator} />
{locationRowVisible && (
<div className={styles.authSessionLocation}>
{hasLocation && <span className={styles.locationText}>{authSession.clientLocation}</span>}
{!isCurrent && hasLocation && <span aria-hidden className={styles.locationSeparator} />}
{!isCurrent && (
<span className={styles.lastUsed}>
{DateUtils.getShortRelativeDateString(authSession.approxLastUsedAt ?? new Date(0))}
</span>
</>
)}
</div>
)}
</div>
)}
</div>
</div>

View File

@@ -22,7 +22,7 @@ export type AuthSession = Readonly<{
approx_last_used_at: string | null;
client_os: string;
client_platform: string;
client_location: string;
client_location: string | null;
}>;
export class AuthSessionRecord {
@@ -30,7 +30,7 @@ export class AuthSessionRecord {
readonly approxLastUsedAt: Date | null;
readonly clientOs: string;
readonly clientPlatform: string;
readonly clientLocation: string;
readonly clientLocation: string | null;
constructor(data: AuthSession) {
this.id = data.id;