fix: timeline scroll error handling (#21324)

This commit is contained in:
Jason Rasmussen 2025-08-26 18:07:26 -04:00 committed by GitHub
parent d5fec0edab
commit 76eaee3657
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -419,14 +419,22 @@ export class TimelineManager {
if (!this.isInitialized) { if (!this.isInitialized) {
await this.initTask.waitUntilCompletion(); await this.initTask.waitUntilCompletion();
} }
let { monthGroup } = findMonthGroupForAssetUtil(this, id) ?? {}; let { monthGroup } = findMonthGroupForAssetUtil(this, id) ?? {};
if (monthGroup) { if (monthGroup) {
return monthGroup; return monthGroup;
} }
const asset = toTimelineAsset(await getAssetInfo({ ...authManager.params, id }));
const response = await getAssetInfo({ ...authManager.params, id }).catch(() => null);
if (!response) {
return;
}
const asset = toTimelineAsset(response);
if (!asset || this.isExcluded(asset)) { if (!asset || this.isExcluded(asset)) {
return; return;
} }
monthGroup = await this.#loadMonthGroupAtTime(asset.localDateTime, { cancelable: false }); monthGroup = await this.#loadMonthGroupAtTime(asset.localDateTime, { cancelable: false });
if (monthGroup?.findAssetById({ id })) { if (monthGroup?.findAssetById({ id })) {
return monthGroup; return monthGroup;