aboutsummaryrefslogtreecommitdiffstats
path: root/ui/src/state/store.ts
diff options
context:
space:
mode:
authorEllie Huxtable <ellie@elliehuxtable.com>2024-06-18 17:11:24 +0100
committerGitHub <noreply@github.com>2024-06-18 17:11:24 +0100
commitb8be23ee99f47c89d9c9f4ce508b940efc88b1ca (patch)
treead5ba50590f0cdb11b2ea4540795ced931ee7c30 /ui/src/state/store.ts
parentfeat(tui): configurable prefix character (#2157) (diff)
downloadatuin-b8be23ee99f47c89d9c9f4ce508b940efc88b1ca.zip
feat(gui): add activity calendar to the homepage (#2160)
* feat(gui): add activity calendar to the homepage * localise week start
Diffstat (limited to 'ui/src/state/store.ts')
-rw-r--r--ui/src/state/store.ts9
1 files changed, 9 insertions, 0 deletions
diff --git a/ui/src/state/store.ts b/ui/src/state/store.ts
index 1ad5dc32..822abc26 100644
--- a/ui/src/state/store.ts
+++ b/ui/src/state/store.ts
@@ -25,8 +25,10 @@ interface AtuinState {
aliases: Alias[];
vars: Var[];
shellHistory: ShellHistory[];
+ calendar: any[];
refreshHomeInfo: () => void;
+ refreshCalendar: () => void;
refreshAliases: () => void;
refreshVars: () => void;
refreshUser: () => void;
@@ -40,6 +42,7 @@ export const useStore = create<AtuinState>()((set, get) => ({
aliases: [],
vars: [],
shellHistory: [],
+ calendar: [],
refreshAliases: () => {
invoke("aliases").then((aliases: any) => {
@@ -47,6 +50,12 @@ export const useStore = create<AtuinState>()((set, get) => ({
});
},
+ refreshCalendar: () => {
+ invoke("history_calendar").then((calendar: any) => {
+ set({ calendar: calendar });
+ });
+ },
+
refreshVars: () => {
invoke("vars").then((vars: any) => {
set({ vars: vars });