refactor(geoip): reconcile geoip system (#31)
This commit is contained in:
@@ -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>
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user