Spaces:
Running
Running
orztv
commited on
Commit
·
d4f6714
1
Parent(s):
982c207
update
Browse files- src/sshx.tsx +3 -3
src/sshx.tsx
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
import { json, ActionFunction, LoaderFunction } from '@remix-run/node';
|
2 |
-
import { useLoaderData, Form, useSubmit,
|
3 |
import { useEffect, useState, useCallback } from 'react';
|
4 |
import { spawn, ChildProcess } from 'child_process';
|
5 |
|
@@ -79,7 +79,7 @@ function extractFromOutput(output: string, regex: RegExp): string | null {
|
|
79 |
export default function Sshx() {
|
80 |
const { status, output, link, shell } = useLoaderData<LoaderData>();
|
81 |
const submit = useSubmit();
|
82 |
-
const
|
83 |
const [localOutput, setLocalOutput] = useState(output);
|
84 |
|
85 |
const refreshData = useCallback(() => {
|
@@ -95,7 +95,7 @@ export default function Sshx() {
|
|
95 |
setLocalOutput(output);
|
96 |
}, [output]);
|
97 |
|
98 |
-
const isLoading =
|
99 |
|
100 |
const styles = {
|
101 |
container: {
|
|
|
1 |
import { json, ActionFunction, LoaderFunction } from '@remix-run/node';
|
2 |
+
import { useLoaderData, Form, useSubmit, useNavigation } from '@remix-run/react';
|
3 |
import { useEffect, useState, useCallback } from 'react';
|
4 |
import { spawn, ChildProcess } from 'child_process';
|
5 |
|
|
|
79 |
export default function Sshx() {
|
80 |
const { status, output, link, shell } = useLoaderData<LoaderData>();
|
81 |
const submit = useSubmit();
|
82 |
+
const navigation = useNavigation();
|
83 |
const [localOutput, setLocalOutput] = useState(output);
|
84 |
|
85 |
const refreshData = useCallback(() => {
|
|
|
95 |
setLocalOutput(output);
|
96 |
}, [output]);
|
97 |
|
98 |
+
const isLoading = navigation.state === 'submitting' || navigation.state === 'loading';
|
99 |
|
100 |
const styles = {
|
101 |
container: {
|