mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-23 21:06:22 +08:00
feat(editor): unify block props api (#10888)
Closes: [BS-2707](https://linear.app/affine-design/issue/BS-2707/统一使用props获取和更新block-prop)
This commit is contained in:
@@ -151,7 +151,7 @@ export class AttachmentViewerPanel extends SignalWatcher(
|
||||
open(model: AttachmentBlockModel) {
|
||||
this.#dialog.showModal();
|
||||
|
||||
const { name, size } = model;
|
||||
const { name, size } = model.props;
|
||||
|
||||
const fileType = name.split('.').pop() ?? '';
|
||||
const icon = getAttachmentFileIcon(fileType);
|
||||
@@ -165,7 +165,7 @@ export class AttachmentViewerPanel extends SignalWatcher(
|
||||
};
|
||||
|
||||
if (!isPDF) return;
|
||||
if (!model.sourceId) return;
|
||||
if (!model.props.sourceId) return;
|
||||
if (this.#worker) return;
|
||||
|
||||
const process = async ({ data }: MessageEvent<MessageData>) => {
|
||||
@@ -182,7 +182,7 @@ export class AttachmentViewerPanel extends SignalWatcher(
|
||||
console.debug('connected');
|
||||
this.#state.value = State.Connected;
|
||||
|
||||
const blob = await model.doc.blobSync.get(model.sourceId!);
|
||||
const blob = await model.doc.blobSync.get(model.props.sourceId!);
|
||||
|
||||
if (!blob) return;
|
||||
const buffer = await blob.arrayBuffer();
|
||||
|
||||
Reference in New Issue
Block a user