File tree Expand file tree Collapse file tree 1 file changed +20
-20
lines changed
packages/frontend/core/src/modules/editor/entities Expand file tree Collapse file tree 1 file changed +20
-20
lines changed Original file line number Diff line number Diff line change @@ -181,20 +181,20 @@ export class Editor extends Entity {
181181 > ( 'rich-text' ) ;
182182 title ?. inlineEditor . focusEnd ( ) ;
183183 }
184- unsubs . push (
185- focusAt$
186- . distinctUntilChanged (
187- ( a , b ) => a ?. id === b ?. id && a ?. refreshKey === b ?. refreshKey
188- )
189- . subscribe ( params => {
190- if ( params ?. id ) {
191- const std = editorContainer . host ?. std ;
192- if ( std ) {
193- scrollAnchoring ( std , this . mode$ . value , params . id ) ;
194- }
184+
185+ const subscription = focusAt$
186+ . distinctUntilChanged (
187+ ( a , b ) => a ?. id === b ?. id && a ?. refreshKey === b ?. refreshKey
188+ )
189+ . subscribe ( params => {
190+ if ( params ?. id ) {
191+ const std = editorContainer . host ?. std ;
192+ if ( std ) {
193+ scrollAnchoring ( std , this . mode$ . value , params . id ) ;
195194 }
196- } ) . unsubscribe
197- ) ;
195+ }
196+ } ) ;
197+ unsubs . push ( subscription . unsubscribe . bind ( subscription ) ) ;
198198
199199 const edgelessPage = editorContainer . host ?. querySelector (
200200 'affine-edgeless-root'
@@ -205,13 +205,13 @@ export class Editor extends Entity {
205205 this . isPresenting$ . next (
206206 edgelessPage . edgelessTool . type === 'frameNavigator'
207207 ) ;
208- unsubs . push (
209- edgelessPage . slots . edgelessToolUpdated . on ( ( ) => {
210- this . isPresenting$ . next (
211- edgelessPage . edgelessTool . type === 'frameNavigator'
212- ) ;
213- } ) . dispose
214- ) ;
208+
209+ const disposable = edgelessPage . slots . edgelessToolUpdated . on ( ( ) => {
210+ this . isPresenting$ . next (
211+ edgelessPage . edgelessTool . type === 'frameNavigator'
212+ ) ;
213+ } ) ;
214+ unsubs . push ( disposable . dispose . bind ( disposable ) ) ;
215215 }
216216
217217 return ( ) => {
You can’t perform that action at this time.
0 commit comments