summaryrefslogtreecommitdiff
path: root/src/web/app/common/scripts/api.ls
diff options
context:
space:
mode:
authorsyuilo⭐️ <Syuilotan@yahoo.co.jp>2017-02-03 15:07:52 +0900
committerGitHub <noreply@github.com>2017-02-03 15:07:52 +0900
commit9e75a73619affd41c559416b68d14fe4aa26e666 (patch)
treeee3d0245a57c26ba6333813c305c1e9878d9e407 /src/web/app/common/scripts/api.ls
parentMerge branch 'master' of https://github.com/syuilo/misskey (diff)
downloadsharkey-9e75a73619affd41c559416b68d14fe4aa26e666.tar.gz
sharkey-9e75a73619affd41c559416b68d14fe4aa26e666.tar.bz2
sharkey-9e75a73619affd41c559416b68d14fe4aa26e666.zip
[Client] Refactor
Diffstat (limited to 'src/web/app/common/scripts/api.ls')
-rw-r--r--src/web/app/common/scripts/api.ls6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/web/app/common/scripts/api.ls b/src/web/app/common/scripts/api.ls
index 7ebd645db4..c96e51b1a8 100644
--- a/src/web/app/common/scripts/api.ls
+++ b/src/web/app/common/scripts/api.ls
@@ -9,8 +9,7 @@ riot.mixin \net do
net: net
module.exports = (i, endpoint, data) ->
- pending++
- if pending == 1
+ if ++pending == 1
spinner := document.create-element \div
..set-attribute \id \wait
document.body.append-child spinner
@@ -47,9 +46,8 @@ module.exports = (i, endpoint, data) ->
fetch ep, opts
.then (res) ->
- pending--
clear-timeout timer
- if pending == 0
+ if --pending == 0
spinner.parent-node.remove-child spinner
if res.status == 200