Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
N
new_excelso
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Prasetya Saputra
new_excelso
Commits
6bfb57ca
Commit
6bfb57ca
authored
Aug 22, 2020
by
Fred
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix spinner gak tutup kalo gagal request api
parent
6624f4ba
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
58 additions
and
28 deletions
+58
-28
CardActivation.js
view/CardActivation.js
+58
-28
No files found.
view/CardActivation.js
View file @
6bfb57ca
...
@@ -106,24 +106,40 @@ class CardActivation extends React.Component {
...
@@ -106,24 +106,40 @@ class CardActivation extends React.Component {
mobile_phone
:
this
.
state
.
mobile_phone
mobile_phone
:
this
.
state
.
mobile_phone
}
}
Axios
.
post
(
this
.
props
.
BASE_URL
+
'crm/v2/get_token'
,
params
).
then
(
res
=>
{
Axios
.
post
(
this
.
props
.
BASE_URL
+
'crm/v2/get_token'
,
params
).
then
(
res
=>
{
Alert
.
alert
(
''
,
i18n
.
t
(
'alertSendOTP'
),
[
{
text
:
'OK'
,
onPress
:
()
=>
{
this
.
setState
({
this
.
setState
({
onclick
:
true
onclick
:
true
,
spinner
:
false
})
})
Alert
.
alert
(
i18n
.
t
(
'alertSendOTP'
));
this
.
interval
=
setInterval
(
this
.
interval
=
setInterval
(
()
=>
this
.
setState
((
prevState
)
=>
({
timer
:
prevState
.
timer
-
1
})),
()
=>
this
.
setState
((
prevState
)
=>
({
timer
:
prevState
.
timer
-
1
})),
1000
1000
);
);
this
.
setState
({
}
onclick
:
true
,
}
spinner
:
false
]
})
);
}).
catch
(
error
=>
{
}).
catch
(
error
=>
{
let
response
=
error
.
response
.
data
;
let
response
=
error
.
response
.
data
;
// const { navigation } = this.props
// const { navigation } = this.props
// session(response, navigation)
// session(response, navigation)
Alert
.
alert
(
''
,
response
.
msg
);
Alert
.
alert
(
''
,
response
.
msg
,
[
{
text
:
'OK'
,
onPress
:
()
=>
this
.
setState
({
spinner
:
false
,
})
}
]
);
})
})
}
}
...
@@ -138,24 +154,38 @@ class CardActivation extends React.Component {
...
@@ -138,24 +154,38 @@ class CardActivation extends React.Component {
mobile_phone
:
this
.
state
.
mobile_phone
mobile_phone
:
this
.
state
.
mobile_phone
}
}
Axios
.
post
(
this
.
props
.
BASE_URL
+
'crm/v2/resend_token'
,
params
).
then
(
res
=>
{
Axios
.
post
(
this
.
props
.
BASE_URL
+
'crm/v2/resend_token'
,
params
).
then
(
res
=>
{
Alert
.
alert
(
''
,
i18n
.
t
(
'alertSendOTP'
),
[
{
text
:
'OK'
,
onPress
:
()
=>
{
this
.
setState
({
this
.
setState
({
spinner
:
false
,
spinner
:
false
,
})
Alert
.
alert
(
i18n
.
t
(
'alertSendOTP'
));
this
.
setState
({
timer
:
80
timer
:
80
})
})
this
.
interval
=
setInterval
(
this
.
interval
=
setInterval
(
()
=>
this
.
setState
((
prevState
)
=>
({
timer
:
prevState
.
timer
-
1
})),
()
=>
this
.
setState
((
prevState
)
=>
({
timer
:
prevState
.
timer
-
1
})),
1000
1000
);
);
}
}
]
);
}).
catch
(
error
=>
{
}).
catch
(
error
=>
{
this
.
setState
({
let
response
=
error
.
response
.
data
;
Alert
.
alert
(
''
,
response
.
msg
,
[
{
text
:
'OK'
,
onPress
:
()
=>
this
.
setState
({
spinner
:
false
,
spinner
:
false
,
})
})
let
response
=
error
.
response
.
data
;
}
Alert
.
alert
(
''
,
response
.
msg
);
]
);
})
})
}
}
...
...
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