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
b6270812
Unverified
Commit
b6270812
authored
Jun 25, 2020
by
Benjamin Wheeler
Committed by
GitHub
Jun 25, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4002 from R4356th/patch-1
Change the way usernames are handled
parents
75dbbd02
364f6da1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
src/components/join-flow/username-step.jsx
src/components/join-flow/username-step.jsx
+2
-2
No files found.
src/components/join-flow/username-step.jsx
View file @
b6270812
...
@@ -34,7 +34,7 @@ class UsernameStep extends React.Component {
...
@@ -34,7 +34,7 @@ class UsernameStep extends React.Component {
};
};
// simple object to memoize remote requests for usernames.
// simple object to memoize remote requests for usernames.
// keeps us from submitting multiple requests for same data.
// keeps us from submitting multiple requests for same data.
this
.
usernameRemoteCache
=
{}
;
this
.
usernameRemoteCache
=
Object
.
create
(
null
)
;
}
}
componentDidMount
()
{
componentDidMount
()
{
// Send info to analytics when we aren't on the standalone page.
// Send info to analytics when we aren't on the standalone page.
...
@@ -58,7 +58,7 @@ class UsernameStep extends React.Component {
...
@@ -58,7 +58,7 @@ class UsernameStep extends React.Component {
}
}
// simple function to memoize remote requests for usernames
// simple function to memoize remote requests for usernames
validateUsernameRemotelyWithCache
(
username
)
{
validateUsernameRemotelyWithCache
(
username
)
{
if
(
t
his
.
usernameRemoteCache
.
hasOwnProperty
(
username
)
)
{
if
(
t
ypeof
this
.
usernameRemoteCache
[
username
]
===
'
object
'
)
{
return
Promise
.
resolve
(
this
.
usernameRemoteCache
[
username
]);
return
Promise
.
resolve
(
this
.
usernameRemoteCache
[
username
]);
}
}
// username is not in our cache
// username is not in our cache
...
...
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