mirror of
https://github.com/toeverything/AFFiNE.git
synced 2025-01-02 00:13:01 +03:00
fix(core): should be bound to the correct object (#8121)
<img width="795" alt="Screenshot 2024-09-05 at 18 05 35" src="https://github.com/user-attachments/assets/46f277e9-9be6-4f71-b765-fc442a3a9c64">
This commit is contained in:
parent
d3f50a2e38
commit
017e89f458
@ -181,20 +181,20 @@ export class Editor extends Entity {
|
||||
>('rich-text');
|
||||
title?.inlineEditor.focusEnd();
|
||||
}
|
||||
unsubs.push(
|
||||
focusAt$
|
||||
.distinctUntilChanged(
|
||||
(a, b) => a?.id === b?.id && a?.refreshKey === b?.refreshKey
|
||||
)
|
||||
.subscribe(params => {
|
||||
if (params?.id) {
|
||||
const std = editorContainer.host?.std;
|
||||
if (std) {
|
||||
scrollAnchoring(std, this.mode$.value, params.id);
|
||||
}
|
||||
|
||||
const subscription = focusAt$
|
||||
.distinctUntilChanged(
|
||||
(a, b) => a?.id === b?.id && a?.refreshKey === b?.refreshKey
|
||||
)
|
||||
.subscribe(params => {
|
||||
if (params?.id) {
|
||||
const std = editorContainer.host?.std;
|
||||
if (std) {
|
||||
scrollAnchoring(std, this.mode$.value, params.id);
|
||||
}
|
||||
}).unsubscribe
|
||||
);
|
||||
}
|
||||
});
|
||||
unsubs.push(subscription.unsubscribe.bind(subscription));
|
||||
|
||||
const edgelessPage = editorContainer.host?.querySelector(
|
||||
'affine-edgeless-root'
|
||||
@ -205,13 +205,13 @@ export class Editor extends Entity {
|
||||
this.isPresenting$.next(
|
||||
edgelessPage.edgelessTool.type === 'frameNavigator'
|
||||
);
|
||||
unsubs.push(
|
||||
edgelessPage.slots.edgelessToolUpdated.on(() => {
|
||||
this.isPresenting$.next(
|
||||
edgelessPage.edgelessTool.type === 'frameNavigator'
|
||||
);
|
||||
}).dispose
|
||||
);
|
||||
|
||||
const disposable = edgelessPage.slots.edgelessToolUpdated.on(() => {
|
||||
this.isPresenting$.next(
|
||||
edgelessPage.edgelessTool.type === 'frameNavigator'
|
||||
);
|
||||
});
|
||||
unsubs.push(disposable.dispose.bind(disposable));
|
||||
}
|
||||
|
||||
return () => {
|
||||
|
Loading…
Reference in New Issue
Block a user