mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-12 08:54:00 +02:00
Desktop: Fixes #3962: Certain commands no longer worked.
This commit is contained in:
parent
0cede5f90a
commit
5e040c062c
@ -138,8 +138,8 @@ function useMenu(props:Props) {
|
||||
const [modulesLastChangeTime, setModulesLastChangeTime] = useState(Date.now());
|
||||
|
||||
const onMenuItemClick = useCallback((commandName:string) => {
|
||||
CommandService.instance().execute(commandName, props.menuItemProps[commandName]);
|
||||
}, [props.menuItemProps]);
|
||||
CommandService.instance().execute(commandName);
|
||||
}, []);
|
||||
|
||||
const onImportModuleClick = useCallback(async (module:Module, moduleSource:string) => {
|
||||
let path = null;
|
||||
|
@ -12,7 +12,9 @@ export const declaration:CommandDeclaration = {
|
||||
// synchronisation depending on the "syncStarted" parameter
|
||||
export const runtime = ():CommandRuntime => {
|
||||
return {
|
||||
execute: async (_context:CommandContext, syncStarted:boolean = false) => {
|
||||
execute: async (context:CommandContext, syncStarted:boolean = null) => {
|
||||
syncStarted = syncStarted === null ? context.state.syncStarted : syncStarted;
|
||||
|
||||
const action = syncStarted ? 'cancel' : 'start';
|
||||
|
||||
if (!(await reg.syncTarget().isAuthenticated())) {
|
||||
|
Loading…
Reference in New Issue
Block a user