-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove string constants and internal wrapping functions
- Loading branch information
Showing
4 changed files
with
35 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 4 additions & 7 deletions
11
packages/app-desktop/gui/MainScreen/commands/notesSortOrderToggleReverse.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,18 @@ | ||
import CommandService, { CommandContext, CommandDeclaration, CommandRuntime } from '@joplin/lib/services/CommandService'; | ||
import Setting from '@joplin/lib/models/Setting'; | ||
import { _ } from '@joplin/lib/locale'; | ||
import { NOTES_SORT_ORDER_SWITCH, SETTING_REVERSE } from './notesSortOrderSwitch'; | ||
|
||
export const NOTES_SORT_ORDER_TOGGLE_REVERSE = 'notesSortOrderToggleReverse'; | ||
|
||
export const declaration: CommandDeclaration = { | ||
name: NOTES_SORT_ORDER_TOGGLE_REVERSE, | ||
label: () => Setting.settingMetadata(SETTING_REVERSE).label(), | ||
name: 'notesSortOrderToggleReverse', | ||
label: () => Setting.settingMetadata('notes.sortOrder.reverse').label(), | ||
parentLabel: () => _('Notes'), | ||
}; | ||
|
||
export const runtime = (): CommandRuntime => { | ||
return { | ||
execute: async (_context: CommandContext) => { | ||
const reverse = Setting.value(SETTING_REVERSE); | ||
return CommandService.instance().execute(NOTES_SORT_ORDER_SWITCH, undefined, !reverse); | ||
const reverse = Setting.value('notes.sortOrder.reverse'); | ||
return CommandService.instance().execute('notesSortOrderSwitch', undefined, !reverse); | ||
}, | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters