Skip to content

Commit

Permalink
bugfix: list of tasks reersed after sync
Browse files Browse the repository at this point in the history
  • Loading branch information
mk1123 committed Apr 8, 2021
1 parent b3f9e36 commit c0442ad
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions timebox.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,17 +174,15 @@ def inner_callback(_, j=time):
self.timer.start()
return inner_callback

self.things_buttons = {
f"{title}": rumps.MenuItem(
self.things_buttons = {}
for idx, (title, time) in reversed(list(enumerate(self.things_processed_tasks.items()))):
menu_item = rumps.MenuItem(
title=f"({time} min) {title}",
callback=callback(time),
key=str(idx % 10) if idx < 10 else ""
)
for idx, (title, time) in enumerate(self.things_processed_tasks.items())
}

for title, menu_item in self.things_buttons.items():
self.app.menu.insert_after("hours_spent", menu_item)
self.things_buttons[title] = menu_item
self.app.menu.insert_after("hours_spent", menu_item)

def run(self):
self.app.menu[
Expand Down

0 comments on commit c0442ad

Please sign in to comment.