Skip to content

Commit

Permalink
fix indent of axios.
Browse files Browse the repository at this point in the history
  • Loading branch information
lebrinkma committed Sep 9, 2024
1 parent 3ac407b commit 54aff4b
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions lib/statescontroller.js
Original file line number Diff line number Diff line change
Expand Up @@ -540,18 +540,18 @@ class StatesController extends EventEmitter {
async downloadIcon(url, image_path) {
if (!fs.existsSync(image_path)) {
return new Promise((resolve, reject) => {
axios({
method: 'get',
url: url,
responseType: 'stream' // Dies ist wichtig, um den Stream direkt zu erhalten
}).then(response => {
const writer = fs.createWriteStream(image_path);
response.data.pipe(writer);
writer.on('finish', resolve);
writer.on('error', reject);
}).catch(err => {
reject(err);
});
axios({
method: 'get',
url: url,
responseType: 'stream' // Dies ist wichtig, um den Stream direkt zu erhalten
}).then(response => {
const writer = fs.createWriteStream(image_path);
response.data.pipe(writer);
writer.on('finish', resolve);
writer.on('error', reject);
}).catch(err => {
reject(err);
});
});
}
}
Expand Down

0 comments on commit 54aff4b

Please sign in to comment.