From aed2c2a9cbe6aad116edfb0bb74c56f345ba5554 Mon Sep 17 00:00:00 2001 From: hole-thu Date: Tue, 8 Sep 2020 15:32:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B8=85=E7=90=86=E6=96=87=E4=BB=B6=20?= =?UTF-8?q?=E5=90=8C=E6=AD=A5=E6=9B=B4=E6=96=B0likenum?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .travis.yml | 10 ---------- package.json | 2 +- src/Flows.js | 16 ++++++++++++---- 3 files changed, 13 insertions(+), 15 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 4c509f9..0000000 --- a/.travis.yml +++ /dev/null @@ -1,10 +0,0 @@ -language: node_js -node_js: - - 12 -cache: - directories: - - node_modules - -after_success: - - chmod +x ./travis_deploy.sh - - ./travis_deploy.sh diff --git a/package.json b/package.json index 3fed50e..e5bb59b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "webhole", - "version": "0.3.1", + "version": "1.1.0", "private": true, "dependencies": { "copy-to-clipboard": "^3.3.1", diff --git a/src/Flows.js b/src/Flows.js index 9e9dc95..2c02775 100644 --- a/src/Flows.js +++ b/src/Flows.js @@ -369,6 +369,7 @@ class FlowSidebar extends PureComponent { info: update_count ? Object.assign({}, prev.info, { reply: '' + json.data.length, + likenum: ''+json.likenum, }) : prev.info, attention: !!json.attention, @@ -405,15 +406,22 @@ class FlowSidebar extends PureComponent { this.setState({ loading_status: 'loading', }); - const next_attention = !this.state.attention; - API.set_attention(this.state.info.pid, next_attention, this.props.token) + const prev_info = this.state.info; + API.set_attention(this.state.info.pid, !this.state.attention, this.props.token) .then((json) => { this.setState({ loading_status: 'done', - attention: next_attention, + attention: json.attention, + info: Object.assign({}, prev_info, { + likenum: ''+json.likenum, + }), }); + console.log(json); this.syncState({ - attention: next_attention, + attention: json.attention, + info: Object.assign({}, prev_info, { + likenum: ''+json.likenum, + }), }); }) .catch((e) => {