Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
scratch-www
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
scratch-www
Commits
6834d675
Commit
6834d675
authored
Aug 24, 2021
by
Eric Rosenbaum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
disable confirm button while submitting
parent
5d838ef6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
src/views/studio/modals/transfer-host-confirmation.jsx
src/views/studio/modals/transfer-host-confirmation.jsx
+4
-1
No files found.
src/views/studio/modals/transfer-host-confirmation.jsx
View file @
6834d675
...
...
@@ -31,6 +31,7 @@ const TransferHostConfirmation = ({
const
newHostUsername
=
items
.
find
(
item
=>
item
.
id
===
selectedId
).
username
;
const
newHostImage
=
items
.
find
(
item
=>
item
.
id
===
selectedId
).
profile
.
images
[
'
90x90
'
];
const
[
passwordInputValue
,
setPasswordInputValue
]
=
useState
(
''
);
const
[
submitting
,
setSubmitting
]
=
useState
(
false
);
const
[
validationError
,
setValidationError
]
=
useState
(
null
);
const
{
errorAlert
,
successAlert
}
=
useAlertContext
();
...
...
@@ -43,6 +44,7 @@ const TransferHostConfirmation = ({
};
const
handleSubmit
=
()
=>
{
setSubmitting
(
true
);
handleTransferHost
(
passwordInputValue
,
newHostUsername
,
selectedId
)
.
then
(()
=>
{
handleClose
();
...
...
@@ -54,6 +56,7 @@ const TransferHostConfirmation = ({
.
catch
(
e
=>
{
// For password errors, show validation alert without closing the modal
if
(
e
===
Errors
.
PERMISSION
)
{
setSubmitting
(
false
);
setValidationError
(
e
);
return
;
}
...
...
@@ -149,7 +152,7 @@ const TransferHostConfirmation = ({
<
button
className=
"button"
type=
"submit"
disabled=
{
passwordInputValue
===
''
||
validationError
}
disabled=
{
passwordInputValue
===
''
||
submitting
||
validationError
}
>
<
FormattedMessage
id=
"studio.confirm"
/>
</
button
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment