aboutsummaryrefslogtreecommitdiffstats
path: root/ui/src/state
diff options
context:
space:
mode:
Diffstat (limited to 'ui/src/state')
-rw-r--r--ui/src/state/models.ts6
-rw-r--r--ui/src/state/store.ts9
2 files changed, 15 insertions, 0 deletions
diff --git a/ui/src/state/models.ts b/ui/src/state/models.ts
index f11ce651..5afcb804 100644
--- a/ui/src/state/models.ts
+++ b/ui/src/state/models.ts
@@ -32,3 +32,9 @@ export interface Alias {
name: string;
value: string;
}
+
+export interface Var {
+ name: string;
+ value: string;
+ export: bool;
+}
diff --git a/ui/src/state/store.ts b/ui/src/state/store.ts
index 08410ba8..7e237d70 100644
--- a/ui/src/state/store.ts
+++ b/ui/src/state/store.ts
@@ -19,10 +19,12 @@ interface AtuinState {
user: User;
homeInfo: HomeInfo;
aliases: Alias[];
+ vars: Var[];
shellHistory: ShellHistory[];
refreshHomeInfo: () => void;
refreshAliases: () => void;
+ refreshVars: () => void;
refreshShellHistory: (query?: string) => void;
}
@@ -30,6 +32,7 @@ export const useStore = create<AtuinState>()((set) => ({
user: DefaultUser,
homeInfo: DefaultHomeInfo,
aliases: [],
+ vars: [],
shellHistory: [],
refreshAliases: () => {
@@ -38,6 +41,12 @@ export const useStore = create<AtuinState>()((set) => ({
});
},
+ refreshVars: () => {
+ invoke("vars").then((vars: any) => {
+ set({ vars: vars });
+ });
+ },
+
refreshShellHistory: (query?: string) => {
if (query) {
invoke("search", { query: query })