From db77bba802b41c0eb429f58eaaad0e6ba614592d Mon Sep 17 00:00:00 2001 From: LuanRT Date: Sat, 12 Nov 2022 17:29:07 -0300 Subject: [PATCH] fix(NotificationsCount): default to 0 --- src/Innertube.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Innertube.ts b/src/Innertube.ts index 99e6f026..b4dc5bbd 100644 --- a/src/Innertube.ts +++ b/src/Innertube.ts @@ -215,7 +215,7 @@ class Innertube { async getUnseenNotificationsCount(): Promise { const response = await this.actions.execute('/notification/get_unseen_count'); // TODO: properly parse this - return response.data?.unseenCount || response.data.actions?.[0].updateNotificationsUnseenCountAction?.unseenCount; + return response.data?.unseenCount || response.data?.actions?.[0].updateNotificationsUnseenCountAction?.unseenCount || 0; } /**