File tree 1 file changed +12
-12
lines changed
1 file changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -1002,21 +1002,21 @@ export default class NoteTreeWidget extends NoteContextAwareWidget {
1002
1002
this . activityDetected ( ) ;
1003
1003
1004
1004
const oldActiveNode = this . getActiveNode ( ) ;
1005
- let oldActiveNodeFocused = false ;
1006
1005
1007
- if ( oldActiveNode ) {
1008
- oldActiveNodeFocused = oldActiveNode . hasFocus ( ) ;
1009
-
1010
- oldActiveNode . setActive ( false ) ;
1011
- oldActiveNode . setFocus ( false ) ;
1012
- }
1013
-
1014
- if ( this . noteContext
1015
- && this . noteContext . notePath
1006
+ const newActiveNode = this . noteContext ?. notePath
1016
1007
&& ! this . noteContext . note ?. isDeleted
1017
1008
&& ( ! treeService . isNotePathInHiddenSubtree ( this . noteContext . notePath ) || await hoistedNoteService . isHoistedInHiddenSubtree ( ) )
1018
- ) {
1019
- const newActiveNode = await this . getNodeFromPath ( this . noteContext . notePath ) ;
1009
+ && await this . getNodeFromPath ( this . noteContext . notePath ) ;
1010
+
1011
+ if ( newActiveNode !== oldActiveNode ) {
1012
+ let oldActiveNodeFocused = false ;
1013
+
1014
+ if ( oldActiveNode ) {
1015
+ oldActiveNodeFocused = oldActiveNode . hasFocus ( ) ;
1016
+
1017
+ oldActiveNode . setActive ( false ) ;
1018
+ oldActiveNode . setFocus ( false ) ;
1019
+ }
1020
1020
1021
1021
if ( newActiveNode ) {
1022
1022
if ( ! newActiveNode . isVisible ( ) ) {
You can’t perform that action at this time.
0 commit comments