aboutsummaryrefslogtreecommitdiffstats
path: root/packages/mobile/lib/last-shared-intent.ts
blob: 951bcf740d62b30dc51b49186169e50769757a95 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import { create } from "zustand";

interface LastSharedIntent {
  lastIntent: string;
  setIntent: (intent: string) => void;
  isPreviouslyShared: (intent: string) => boolean;
}

export const useLastSharedIntent = create<LastSharedIntent>((set, get) => ({
  lastIntent: "",
  setIntent: (intent: string) => set({ lastIntent: intent }),
  isPreviouslyShared: (intent: string) => {
    return get().lastIntent === intent;
  },
}));