fix merge fallout after master into stdb

This commit is contained in:
2026-04-20 08:11:42 +00:00
parent 69fc2428a2
commit 46aafce59e
5 changed files with 99 additions and 8 deletions

View File

@@ -219,8 +219,11 @@ test('account panel includes merged security devices and audit sections', async
sessions: [
{
sessionId: 'session-1',
clientType: 'ios',
clientLabel: 'iPhone 15 Pro',
userAgent: 'Mobile Safari',
isCurrent: true,
createdAt: '2026-04-20T07:30:00.000Z',
lastSeenAt: '2026-04-20T09:00:00.000Z',
expiresAt: '2026-04-27T09:00:00.000Z',
ipMasked: '10.0.*.*',
@@ -229,10 +232,12 @@ test('account panel includes merged security devices and audit sections', async
auditLogs: [
{
id: 'log-1',
eventType: 'phone_login',
title: '登录成功',
detail: '通过手机号验证码完成登录。',
createdAt: '2026-04-20T08:00:00.000Z',
ipMasked: '10.0.*.*',
userAgent: 'Mobile Safari',
},
],
});

View File

@@ -90,6 +90,9 @@ export const SCENE_TRANSITION_SPEED_PX_PER_S =
/ SCENE_TRANSITION_REFERENCE_DURATION_S;
export const SCENE_TRANSITION_UPPER_COMPANION_DELAY_S = 0.43;
export const SCENE_TRANSITION_LOWER_COMPANION_DELAY_S = 0.93;
const DEFAULT_IMAGE_STYLE: React.CSSProperties = {
imageRendering: 'pixelated',
};
export function getCompanionSlotOffset(slot: CompanionRenderState['slot']) {
return slot === 'upper'

View File

@@ -92,11 +92,14 @@ function toBigIntMs(isoValue?: string) {
}
function buildRequestMeta() {
const userAgent =
typeof navigator !== 'undefined'
? navigator.userAgent.trim() || undefined
: undefined;
return {
clientType: 'web',
userAgent:
typeof navigator !== 'undefined' ? navigator.userAgent.trim() || null : null,
ip: null,
userAgent,
ip: undefined,
};
}
@@ -165,7 +168,7 @@ export async function putSaveSnapshot(
bottomTab: snapshot.bottomTab,
currentStoryJson:
snapshot.currentStory === null || snapshot.currentStory === undefined
? null
? undefined
: JSON.stringify(snapshot.currentStory),
});
@@ -329,13 +332,13 @@ export async function upsertCustomWorldProfile(
profileId: profile.id,
payloadJson: JSON.stringify(profile),
visibility: { tag: 'Draft' },
publishedAtMs: null,
publishedAtMs: undefined,
updatedAtMs: BigInt(Date.now()),
authorDisplayName: '玩家',
worldName: profile.name,
subtitle: profile.subtitle,
summaryText: profile.summary,
coverImageSrc: null,
coverImageSrc: undefined,
themeMode: { tag: 'Mythic' },
playableNpcCount: profile.playableNpcs.length,
landmarkCount: profile.landmarks.length,
@@ -470,7 +473,7 @@ export async function upsertProfileBrowseHistory(
worldName: entry.worldName,
subtitle: entry.subtitle,
summaryText: entry.summaryText,
coverImageSrc: entry.coverImageSrc,
coverImageSrc: entry.coverImageSrc ?? undefined,
themeMode: mapThemeModeInput(entry.themeMode),
authorDisplayName: entry.authorDisplayName,
visitedAtMs: entry.visitedAt ? toBigIntMs(entry.visitedAt) : 0n,
@@ -498,7 +501,7 @@ export async function syncProfileBrowseHistory(
worldName: entry.worldName,
subtitle: entry.subtitle,
summaryText: entry.summaryText,
coverImageSrc: entry.coverImageSrc,
coverImageSrc: entry.coverImageSrc ?? undefined,
themeMode: mapThemeModeInput(entry.themeMode),
authorDisplayName: entry.authorDisplayName,
visitedAtMs: entry.visitedAt ? toBigIntMs(entry.visitedAt) : 0n,