fix(plugin): guard against NaN fpsAvg bypassing upload check

This commit is contained in:
2026-07-13 04:42:03 +08:00
parent a975497c16
commit fd47803127
2 changed files with 2 additions and 2 deletions
@@ -211,7 +211,7 @@ export default function SessionForm({
setError("No API key configured. Set one in the Settings tab.")
return
}
if (session.fpsAvg == null || session.fpsAvg <= 0) {
if (session.fpsAvg == null || !(session.fpsAvg > 0)) {
setError("No FPS data captured. Re-record the session, or use Export to File only.")
return
}
+1 -1
View File
@@ -256,7 +256,7 @@ export function buildImportPayload(sess: SessionData): DeckyVaultImportV1 {
version: 1,
steamAppId: sess.appId ?? 0,
hardwareSlug: sess.hardwareSlug,
fpsAvg: sess.fpsAvg == null || sess.fpsAvg <= 0 ? 0 : sanitizeFps(sess.fpsAvg)!,
fpsAvg: sess.fpsAvg == null || !(sess.fpsAvg > 0) ? 0 : sanitizeFps(sess.fpsAvg)!,
fpsLow: sanitizeFps(sess.fpsLow),
fpsOnePercentLow: sanitizeFps(sess.fpsOnePercentLow),
fpsHigh: sanitizeFps(sess.fpsHigh),