feat: promisify app.getFileIcon() (#15742)

This commit is contained in:
Shelley Vohr 2018-12-05 08:50:12 -08:00 committed by GitHub
parent cfbea4a0e3
commit 3f15f51615
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 72 additions and 68 deletions

View file

@ -40,9 +40,14 @@ Object.assign(app, {
}
})
const nativeFn = app.getAppMetrics
const nativeGetFileIcon = app.getFileIcon
app.getFileIcon = (path, options = {}, cb) => {
return deprecate.promisify(nativeGetFileIcon.call(app, path, options), cb)
}
const nativeAppMetrics = app.getAppMetrics
app.getAppMetrics = () => {
const metrics = nativeFn.call(app)
const metrics = nativeAppMetrics.call(app)
for (const metric of metrics) {
if ('memory' in metric) {
deprecate.removeProperty(metric, 'memory')