2021-01-28 00:41:17 +05:30
|
|
|
import { register } from "./register";
|
2021-05-12 04:57:35 -04:00
|
|
|
import { CODES, KEYS } from "../keys";
|
2021-01-28 00:41:17 +05:30
|
|
|
|
|
|
|
export const actionToggleStats = register({
|
|
|
|
name: "stats",
|
|
|
|
perform(elements, appState) {
|
|
|
|
return {
|
|
|
|
appState: {
|
|
|
|
...appState,
|
2021-01-29 23:38:37 +05:30
|
|
|
showStats: !this.checked!(appState),
|
2021-01-28 00:41:17 +05:30
|
|
|
},
|
|
|
|
commitToHistory: false,
|
|
|
|
};
|
|
|
|
},
|
2021-01-29 23:38:37 +05:30
|
|
|
checked: (appState) => appState.showStats,
|
2021-01-28 00:41:17 +05:30
|
|
|
contextItemLabel: "stats.title",
|
2021-05-12 04:57:35 -04:00
|
|
|
keyTest: (event) =>
|
|
|
|
!event[KEYS.CTRL_OR_CMD] && event.altKey && event.code === CODES.SLASH,
|
2021-01-28 00:41:17 +05:30
|
|
|
});
|