Skip to content

Commit

Permalink
expose badge method only for desktop apps
Browse files Browse the repository at this point in the history
  • Loading branch information
rafapaezbas committed Nov 21, 2024
1 parent 465a9e2 commit b47a802
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 4 additions & 0 deletions gui/preload.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ module.exports = class PearGUI extends ReadyResource {
},
desktopSources: (options = {}) => ipc.desktopSources(options)
}
this.badge = (count) => {
if (!Number.isInteger(+count)) throw new Error('argument must be an integer')
return ipc.badge(count)
}

const kGuiCtrl = Symbol('gui:ctrl')

Expand Down
5 changes: 0 additions & 5 deletions lib/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,6 @@ class API {
}

exit = (code) => program.exit(code)

badge = (count) => {
if (!Number.isInteger(+count)) throw new Error('argument must be an integer')
return this.#ipc.badge(count)
}
}

module.exports = API

0 comments on commit b47a802

Please sign in to comment.