File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -616,6 +616,17 @@ export default class CustomSortPlugin extends Plugin {
616616 // For the idea of monkey-patching credits go to https://github.com/nothingislost/obsidian-bartender
617617 patchFileExplorerFolder ( patchableFileExplorer ?: FileExplorerView ) : boolean {
618618 let plugin = this ;
619+ const requestStandardObsidianSortAfter = ( patchUninstaller : MonkeyAroundUninstaller | undefined ) => {
620+ return ( ) => {
621+ if ( patchUninstaller ) patchUninstaller ( )
622+
623+ const fileExplorerView : FileExplorerView | undefined = this . checkFileExplorerIsAvailableAndPatchable ( false )
624+ if ( fileExplorerView ) {
625+ fileExplorerView . requestSort ( )
626+ }
627+ }
628+ }
629+
619630 // patching file explorer might fail here because of various non-error reasons.
620631 // That's why not showing and not logging error message here
621632 patchableFileExplorer = patchableFileExplorer ?? this . checkFileExplorerIsAvailableAndPatchable ( false )
@@ -643,7 +654,7 @@ export default class CustomSortPlugin extends Plugin {
643654 } ;
644655 }
645656 } )
646- this . register ( uninstallerOfFolderSortFunctionWrapper )
657+ this . register ( requestStandardObsidianSortAfter ( uninstallerOfFolderSortFunctionWrapper ) )
647658 return true
648659 } else {
649660 // Up to Obsidian 1.6.0
@@ -671,7 +682,7 @@ export default class CustomSortPlugin extends Plugin {
671682 } ;
672683 }
673684 } )
674- this . register ( uninstallerOfFolderSortFunctionWrapper )
685+ this . register ( requestStandardObsidianSortAfter ( uninstallerOfFolderSortFunctionWrapper ) )
675686 return true
676687 }
677688 } else {
You can’t perform that action at this time.
0 commit comments