From b47a80276c3a4a48b5567f070d0cdac33882dbf6 Mon Sep 17 00:00:00 2001 From: rafapaezbas Date: Thu, 21 Nov 2024 13:20:24 +0100 Subject: [PATCH] expose badge method only for desktop apps --- gui/preload.js | 4 ++++ lib/api.js | 5 ----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/gui/preload.js b/gui/preload.js index b9fb0f5e7..c234602f8 100644 --- a/gui/preload.js +++ b/gui/preload.js @@ -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') diff --git a/lib/api.js b/lib/api.js index 10b5daab5..6e413a8a1 100644 --- a/lib/api.js +++ b/lib/api.js @@ -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