You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-07-06 23:56:13 +02:00
Desktop: Make "toggle all folders" button also expand the folder list (#11917)
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
import { CommandRuntime, CommandDeclaration, CommandContext } from '../services/CommandService';
|
||||
import { _ } from '../locale';
|
||||
import getCanBeCollapsedFolderIds from '../models/utils/getCanBeCollapsedFolderIds';
|
||||
import Setting from '../models/Setting';
|
||||
|
||||
export const declaration: CommandDeclaration = {
|
||||
name: 'toggleAllFolders',
|
||||
@ -10,6 +11,10 @@ export const declaration: CommandDeclaration = {
|
||||
export const runtime = (): CommandRuntime => {
|
||||
return {
|
||||
execute: async (context: CommandContext, collapseAll: boolean) => {
|
||||
if (!collapseAll && !Setting.value('folderHeaderIsExpanded')) {
|
||||
Setting.setValue('folderHeaderIsExpanded', true);
|
||||
}
|
||||
|
||||
context.dispatch({
|
||||
type: 'FOLDER_SET_COLLAPSED',
|
||||
ids: collapseAll ? getCanBeCollapsedFolderIds(context.state.folders) : [],
|
||||
|
Reference in New Issue
Block a user