TownieChatRoute.tsx8 matches
46files={project.data?.files}
47branchId={branchId}
48refetch={project.refetch}
49/>
50</>
56files,
57branchId,
58refetch,
59}: {
60project: any;
61files: any[];
62branchId: string;
63refetch: () => void;
64}) {
65const { token, anthropicApiKey } = useAuth();
93if (!messages?.length) return;
94let last = messages.at(-1);
95if (shouldRefetch(last)) {
96refetch();
97}
98}, [messages]);
177}
178179function shouldRefetch (message) {
180for (let i = 0; i < message?.parts?.length; i++) {
181let part = message.parts[i];
184case "str_replace_editor":
185if (part.toolInvocation?.args?.command === "create") {
186// console.log("REFETCH (create)");
187return true;
188}
190case "delete_file":
191case "change_val_type":
192// console.log("REFETCH (change type or delete)");
193return true;
194}
TownieBranchSelect.tsx1 match
33return;
34}
35branches.refetch();
36if (res?.branch?.id) {
37navigate(`/chat/${projectId}/branch/${res.branch.id}`);
snippetsendpoints.tsx2 matches
34try {
5const res = await fetch(url);
6if (!res.ok) {
7return new Response(`Failed to fetch: ${res.status}`, { status: 500 });
8}
9
11}
12const tarballURL = "https://" + path.slice(0, sep).join("/");
13const response = await fetch(tarballURL);
14if (!response.ok) {
15return new Response(response.statusText, { status: response.status });
OpenTownieTODOs.md1 match
47<!--
4849- [x] refetch project data on create/etc
50- [x] Loading favicon
51- [x] Ensure main branch is default selected
OpenTownieLayoutRoute.tsx1 match
45export function LayoutRoute () {
6// TODO fetch here because we're not doing any caching
7// and we want the user data in the header ?
8// const projects = useProjects();
OpenTownieindex.ts1 match
2122// This is the entry point for HTTP vals
23export default app.fetch;
24
stevensDemosendDailyBrief.ts1 match
135const lastSunday = today.startOf("week").minus({ days: 1 });
136137// Fetch relevant memories using the utility function
138const memories = await getRelevantMemories();
139
stevensDemoNotebookView.tsx12 matches
67const [currentPage, setCurrentPage] = useState(1);
6869const fetchMemories = useCallback(async () => {
70setLoading(true);
71setError(null);
72try {
73const response = await fetch(API_BASE);
74if (!response.ok) {
75throw new Error(`HTTP error! status: ${response.status}`);
78setMemories(data);
79} catch (e) {
80console.error("Failed to fetch memories:", e);
81setError(e.message || "Failed to fetch memories.");
82} finally {
83setLoading(false);
8687useEffect(() => {
88fetchMemories();
89}, [fetchMemories]);
9091const handleAddMemory = async (e: React.FormEvent) => {
100101try {
102const response = await fetch(API_BASE, {
103method: "POST",
104headers: { "Content-Type": "application/json" },
112setNewMemoryTags("");
113setShowAddForm(false);
114await fetchMemories();
115} catch (e) {
116console.error("Failed to add memory:", e);
123124try {
125const response = await fetch(`${API_BASE}/${id}`, {
126method: "DELETE",
127});
129throw new Error(`HTTP error! status: ${response.status}`);
130}
131await fetchMemories();
132} catch (e) {
133console.error("Failed to delete memory:", e);
155156try {
157const response = await fetch(`${API_BASE}/${editingMemory.id}`, {
158method: "PUT",
159headers: { "Content-Type": "application/json" },
164}
165setEditingMemory(null);
166await fetchMemories();
167} catch (e) {
168console.error("Failed to update memory:", e);