feat: promisify app.getFileIcon() (#15742)
This commit is contained in:
parent
cfbea4a0e3
commit
3f15f51615
5 changed files with 72 additions and 68 deletions
|
@ -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')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue