perf: ⚡ don't show server loading immediately

This commit is contained in:
Nate Sesti 2023-10-06 19:40:31 -07:00
parent e2a7d4a3c7
commit 5047dfcd2a
3 changed files with 6 additions and 4 deletions

View file

@ -344,7 +344,6 @@ const ComboBox = React.forwardRef((props: ComboBoxProps, ref) => {
useEffect(() => {
if (!nestedContextProvider) {
dispatch(setTakenActionTrue(null));
setItems(
contextProviders?.map((provider) => ({
name: provider.display_title,
@ -437,7 +436,6 @@ const ComboBox = React.forwardRef((props: ComboBoxProps, ref) => {
setNestedContextProvider(undefined);
// Handle slash commands
dispatch(setTakenActionTrue(null));
setItems(
availableSlashCommands?.filter((slashCommand) => {
const sc = slashCommand.name.toLowerCase();
@ -445,6 +443,10 @@ const ComboBox = React.forwardRef((props: ComboBoxProps, ref) => {
return sc.startsWith(iv) && sc !== iv;
}) || []
);
if (inputValue.startsWith("/") || inputValue.startsWith("@")) {
dispatch(setTakenActionTrue(null));
}
},
[
availableSlashCommands,

View file

@ -42,7 +42,7 @@ function ErrorStepContainer(props: ErrorStepContainerProps) {
</HeaderButtonWithText>
</div>
<Div>
<pre className="overflow-x-scroll">
<pre style={{ whiteSpace: "pre-wrap", wordWrap: "break-word" }}>
{props.historyNode.observation?.error as string}
</pre>
</Div>

View file

@ -480,7 +480,7 @@ function GUI(props: GUIProps) {
useEffect(() => {
const timeout = setTimeout(() => {
setShowLoading(true);
}, 10000);
}, 15_000);
return () => {
clearTimeout(timeout);