raycast / extensions

Everything you need to extend Raycast.
https://developers.raycast.com
MIT License
5.37k stars 3.07k forks source link

[Gitlab] Todos Menu Bar Item display even if I have no todos #13612

Closed vincentkoeckerling closed 3 months ago

vincentkoeckerling commented 3 months ago

Extension

https://www.raycast.com/tonka3000/gitlab

Raycast Version

1.79.1

macOS Version

13.6.7

Description

The Todos Menu Bar Item is always visible in the menu bar even though I don't have any active todos. The "Show Always" option in preferences is turned off.

Already tried to deactive/active the menu bar item, disable/enable the menu bar item command and uninstalled/reinstalled the extension.

Settings:

Bildschirmfoto 2024-07-22 um 21 17 31

Menu Bar Item:

Bildschirmfoto 2024-07-22 um 21 18 00

Steps To Reproduce

  1. Extension connected to Gitlab Account with no active todos
  2. Activate "Todos Menu Bar"
  3. Uncheck "Show Always"
  4. Menu Bar Item is still shown

Current Behaviour

The Menu Bar Item is shown even if there are no active todos.

Expected Behaviour

The Menu Bar Item is hidden when there are no active todos and shown when there are.

raycastbot commented 3 months ago

Thank you for opening this issue!

🔔 @tonka3000 @Loskir @immint023 @duboiss @metakirby5 @macbookandrew @shaoye @charl3j @emlez @HBunnick @RomanSchmid you might want to have a look.

💡 Author and Contributors commands The author and contributors of `tonka3000/gitlab` can trigger bot actions by commenting: - `@raycastbot close this issue` Closes the issue. - `@raycastbot rename this issue to "Awesome new title"` Renames the issue. - `@raycastbot reopen this issue` Reopens the issue. - `@raycastbot assign me` Assigns yourself to the issue. - `@raycastbot good first issue` Adds the "Good first issue" label to the issue. - `@raycastbot keep this issue open` Make sure the issue won't go stale and will be kept open by the bot.
jfkisafk commented 3 months ago

The problem is that todos is never undefined here, even when there is no todo(s):

https://github.com/raycast/extensions/blob/6f8fed1702841058d9d7f15b90d22f4a123462fe/extensions/gitlab/src/todomenubar.tsx#L50-L54

Instead of checking !todos, this should check !todos.length as the todos list would be empty in case of no todos.