@agimon-ai/po-git 0.0.0-alpha.42 → 0.0.0-alpha.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -2,7 +2,7 @@ import { createApiClient, defineActivityGroup, defineChannelFile, defineFill, de
|
|
|
2
2
|
import { View } from "react-native-unistyles/components/native/View";
|
|
3
3
|
import { Text } from "react-native-unistyles/components/native/Text";
|
|
4
4
|
import { AlertIcon, Badge, BranchIcon, Button, ChevronRightIcon, Dot, FileIcon, Input, Label, ListRow, MessageIcon, SegmentedControl, Sheet, SheetBody, SheetContent, SheetHeader, SheetTitle, Spinner, SyntaxLine, Textarea, fontOf } from "@agimon-ai/po-native-components";
|
|
5
|
-
import { createElement, memo, useCallback, useEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
|
|
5
|
+
import { createElement, memo, useCallback, useEffect, useEffectEvent, useMemo, useRef, useState, useSyncExternalStore } from "react";
|
|
6
6
|
import { StyleSheet, useUnistyles } from "react-native-unistyles";
|
|
7
7
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
import { ScrollView } from "react-native-unistyles/components/native/ScrollView";
|
|
@@ -303,11 +303,11 @@ function GitNewSessionSheet({ newSession }) {
|
|
|
303
303
|
const [error, setError] = useState("");
|
|
304
304
|
const [busy, setBusy] = useState(false);
|
|
305
305
|
const workspaceId = newSession?.workspaceId;
|
|
306
|
-
const request = newSession?.requestWithStepUp;
|
|
306
|
+
const request = useEffectEvent((input) => newSession?.requestWithStepUp(input));
|
|
307
307
|
useEffect(() => {
|
|
308
|
-
if (workspaceId === void 0
|
|
308
|
+
if (workspaceId === void 0) return;
|
|
309
309
|
let stale = false;
|
|
310
|
-
request(api.workspace(workspaceId).branches.url())
|
|
310
|
+
request(api.workspace(workspaceId).branches.url())?.then(async (response) => {
|
|
311
311
|
const body = await response.json().catch(() => void 0);
|
|
312
312
|
if (stale) return;
|
|
313
313
|
if (!response.ok) setLoadError(errorOf(body, response.status));
|
|
@@ -318,7 +318,7 @@ function GitNewSessionSheet({ newSession }) {
|
|
|
318
318
|
return () => {
|
|
319
319
|
stale = true;
|
|
320
320
|
};
|
|
321
|
-
}, [workspaceId
|
|
321
|
+
}, [workspaceId]);
|
|
322
322
|
if (newSession === void 0) return null;
|
|
323
323
|
const submit = async (state) => {
|
|
324
324
|
if (busy || formProblem(state) !== void 0) return;
|