fix ui: safeguard around prefetched mob keys

This commit is contained in:
nick-delirium 2024-05-28 15:46:04 +02:00
parent 95b8e9656f
commit 7166daee05
No known key found for this signature in database
GPG key ID: 93ABD695DF5FDBA0

View file

@ -183,8 +183,13 @@ export default class SessionStore {
}
const nextEntryNum =
keys.length > 0
? Math.max(...keys.map((key) => this.prefetchedMobUrls[key].entryNum)) +
1
? Math.max(
...keys.map((key) =>
this.prefetchedMobUrls[key]
? this.prefetchedMobUrls[key].entryNum
: 0
)
) + 1
: 0;
this.prefetchedMobUrls[sessionId] = {
data: fileData,