mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-31 00:59:57 +08:00
fix(editor): footnote and citation icon url should be built with image proxy (#12169)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Improved how bookmark and footnote icons are displayed by routing image URLs through an image proxy service for enhanced reliability and consistency. - **Refactor** - Adjusted the timing of service configuration for link previews and image proxies to occur after document initialization, ensuring more robust setup during content rendering. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -4,6 +4,7 @@ import {
|
||||
WebIcon16,
|
||||
} from '@blocksuite/affine-components/icons';
|
||||
import type { FootNote } from '@blocksuite/affine-model';
|
||||
import { ImageProxyService } from '@blocksuite/affine-shared/adapters';
|
||||
import {
|
||||
DocDisplayMetaProvider,
|
||||
LinkPreviewerService,
|
||||
@@ -80,7 +81,10 @@ export class FootNotePopup extends SignalWatcher(WithDisposable(LitElement)) {
|
||||
}
|
||||
|
||||
const favicon = this._linkPreview$.value?.favicon;
|
||||
return favicon ? html`<img src=${favicon} alt="favicon" />` : WebIcon16;
|
||||
const imageSrc = favicon
|
||||
? this.imageProxyService.buildUrl(favicon)
|
||||
: undefined;
|
||||
return imageSrc ? html`<img src=${imageSrc} alt="favicon" />` : WebIcon16;
|
||||
}
|
||||
return undefined;
|
||||
});
|
||||
@@ -190,6 +194,10 @@ export class FootNotePopup extends SignalWatcher(WithDisposable(LitElement)) {
|
||||
`;
|
||||
}
|
||||
|
||||
get imageProxyService() {
|
||||
return this.std.get(ImageProxyService);
|
||||
}
|
||||
|
||||
@property({ attribute: false })
|
||||
accessor footnote!: FootNote;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user