From 9e75a73619affd41c559416b68d14fe4aa26e666 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?syuilo=E2=AD=90=EF=B8=8F?= Date: Fri, 3 Feb 2017 15:07:52 +0900 Subject: [PATCH] [Client] Refactor --- src/web/app/common/scripts/api.ls | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/web/app/common/scripts/api.ls b/src/web/app/common/scripts/api.ls index 7ebd645db..c96e51b1a 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