fix(NotificationsCount): default to 0

This commit is contained in:
LuanRT
2022-11-12 17:29:07 -03:00
parent 5ea0a0ebf8
commit db77bba802

View File

@@ -215,7 +215,7 @@ class Innertube {
async getUnseenNotificationsCount(): Promise<number> {
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;
}
/**