File tree Expand file tree Collapse file tree 1 file changed +1
-12
lines changed Expand file tree Collapse file tree 1 file changed +1
-12
lines changed Original file line number Diff line number Diff line change @@ -10,25 +10,14 @@ const getClaps = url =>
10
10
}
11
11
} ) . then ( response => response . text ( ) ) ;
12
12
13
-
14
- const WAVELENGTH = 60 * 5 ;
15
- const secondsForClap = a => ( WAVELENGTH * Math . asin ( a / 10 ) ) / ( Math . PI * 2 ) ;
16
-
17
- const computeRequest = clapCount => {
18
- const requiredSeconds = secondsForClap ( clapCount ) ;
19
- const serverSeconds = ( Date . now ( ) / 1000 ) % 60 ;
20
- const delta = requiredSeconds - serverSeconds ;
21
- return delta ;
22
- }
23
-
24
13
const updateClaps = ( claps , url ) =>
25
14
// TODO: polyfill for IE (not edge)
26
15
fetch ( `${ API } /update-claps` + ( url ? `?url=${ url } ` : "" ) , {
27
16
method : "POST" ,
28
17
headers : {
29
18
"Content-Type" : "text/plain"
30
19
} ,
31
- body : JSON . stringify ( computeRequest ( claps ) )
20
+ body : JSON . stringify ( claps )
32
21
} ) . then ( response => response . text ( ) ) ;
33
22
34
23
const arrayOfSize = size => new Array ( size ) . fill ( undefined ) ;
You can’t perform that action at this time.
0 commit comments