Skip to content

Commit

Permalink
[Fix] sign up crash #179
Browse files Browse the repository at this point in the history
  • Loading branch information
lixun910 committed Sep 3, 2024
1 parent 90b1e32 commit 0617c19
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions geoda-ai/src/components/user/signup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,16 @@ export function SignUpModal() {

setStatus('sending');
jsonp(url, {param: 'c'}, (err, data) => {
if (data.msg.includes('already subscribed') || data.msg.includes('too many recent signup')) {
const message = data?.msg;
if (
message &&
typeof message === 'string' &&
(message.includes('already subscribed') || message.includes('too many recent signup'))
) {
setStatus('duplicate');
} else if (err) {
setStatus('error');
} else if (data.result !== 'success') {
} else if (data && data.result !== 'success') {
setStatus('error');
} else {
setStatus('success');
Expand Down

0 comments on commit 0617c19

Please sign in to comment.