mirror of
https://iceshrimp.dev/crimekillz/iceshrimp-161sh.git
synced 2024-11-23 04:33:50 +01:00
Refactor
This commit is contained in:
parent
119111baa9
commit
aa09cb5b9d
@ -10,7 +10,11 @@ riot.mixin \net do
|
||||
|
||||
module.exports = (i, endpoint, data) ->
|
||||
pending++
|
||||
|
||||
if pending == 1
|
||||
spinner := document.create-element \div
|
||||
..set-attribute \id \wait
|
||||
document.body.append-child spinner
|
||||
|
||||
if i? and typeof i == \object then i = i.token
|
||||
|
||||
body = []
|
||||
@ -36,11 +40,6 @@ module.exports = (i, endpoint, data) ->
|
||||
then endpoint
|
||||
else "#{CONFIG.api.url}/#{endpoint}"
|
||||
|
||||
if pending == 1
|
||||
spinner := document.create-element \div
|
||||
..set-attribute \id \wait
|
||||
document.body.append-child spinner
|
||||
|
||||
new Promise (resolve, reject) ->
|
||||
timer = set-timeout ->
|
||||
net.trigger \detected-slow-network
|
||||
|
Loading…
Reference in New Issue
Block a user