4624ec2bd6
* fix: pass default value for grid mode / zen mode so it sets the value from initialData appState fixes #2870 * change checked from boolean to be a function which recieves appState and returns boolean * fix * use clsx Co-authored-by: dwelle <luzar.david@gmail.com>
17 lines
365 B
TypeScript
17 lines
365 B
TypeScript
import { register } from "./register";
|
|
|
|
export const actionToggleStats = register({
|
|
name: "stats",
|
|
perform(elements, appState) {
|
|
return {
|
|
appState: {
|
|
...appState,
|
|
showStats: !this.checked!(appState),
|
|
},
|
|
commitToHistory: false,
|
|
};
|
|
},
|
|
checked: (appState) => appState.showStats,
|
|
contextItemLabel: "stats.title",
|
|
});
|