diff options
author | 2021-07-15 15:18:13 +0530 | |
---|---|---|
committer | 2021-07-15 15:18:13 +0530 | |
commit | 9e08551ae5f421a3875fb1fe19bf243508d3dda0 (patch) | |
tree | 65605718e7acfa5a4f832874a347a76c37ee1e51 /src/features/publishDebugInfo | |
parent | 5.6.0-nightly.86 (diff) | |
download | ferdium-app-9e08551ae5f421a3875fb1fe19bf243508d3dda0.tar.gz ferdium-app-9e08551ae5f421a3875fb1fe19bf243508d3dda0.tar.zst ferdium-app-9e08551ae5f421a3875fb1fe19bf243508d3dda0.zip |
Added more logging while publishing of debug info.
Diffstat (limited to 'src/features/publishDebugInfo')
-rw-r--r-- | src/features/publishDebugInfo/Component.js | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/src/features/publishDebugInfo/Component.js b/src/features/publishDebugInfo/Component.js index e7949a0be..f97a7c750 100644 --- a/src/features/publishDebugInfo/Component.js +++ b/src/features/publishDebugInfo/Component.js | |||
@@ -13,6 +13,8 @@ import { DEBUG_API } from '../../config'; | |||
13 | import AppStore from '../../stores/AppStore'; | 13 | import AppStore from '../../stores/AppStore'; |
14 | import ServicesStore from '../../stores/ServicesStore'; | 14 | import ServicesStore from '../../stores/ServicesStore'; |
15 | 15 | ||
16 | const debug = require('debug')('Ferdi:feature:publishDebugInfo'); | ||
17 | |||
16 | const messages = defineMessages({ | 18 | const messages = defineMessages({ |
17 | title: { | 19 | title: { |
18 | id: 'feature.publishDebugInfo.title', | 20 | id: 'feature.publishDebugInfo.title', |
@@ -100,6 +102,7 @@ export default @injectSheet(styles) @inject('stores', 'actions') @observer class | |||
100 | } | 102 | } |
101 | 103 | ||
102 | async publishDebugInfo() { | 104 | async publishDebugInfo() { |
105 | debug('debugInfo: starting publish'); | ||
103 | this.setState({ | 106 | this.setState({ |
104 | isSendingLog: true, | 107 | isSendingLog: true, |
105 | }); | 108 | }); |
@@ -112,17 +115,26 @@ export default @injectSheet(styles) @inject('stores', 'actions') @observer class | |||
112 | log: debugInfo, | 115 | log: debugInfo, |
113 | }), | 116 | }), |
114 | }, false); | 117 | }, false); |
115 | const response = await request.json(); | ||
116 | 118 | ||
117 | if (response.id) { | 119 | debug(`debugInfo: publishing status: ${request.status}`); |
118 | this.setState({ | 120 | if (request.status === 200) { |
119 | log: response.id, | 121 | const response = await request.json(); |
120 | }); | 122 | if (response.id) { |
123 | this.setState({ | ||
124 | log: response.id, | ||
125 | }); | ||
126 | } else { | ||
127 | this.setState({ | ||
128 | error: true, | ||
129 | }); | ||
130 | } | ||
121 | } else { | 131 | } else { |
122 | this.setState({ | 132 | this.setState({ |
123 | error: true, | 133 | error: true, |
124 | }); | 134 | }); |
125 | } | 135 | } |
136 | |||
137 | debug('debugInfo: finished publishing'); | ||
126 | } | 138 | } |
127 | 139 | ||
128 | render() { | 140 | render() { |