heyodai / magic-commit

Generate commit messages with OpenAI’s GPT.
1 stars 0 forks source link

Refactor `run_magic_commit()` function to add optional parameter for showing loading message #36

Closed heyodai closed 1 year ago

heyodai commented 1 year ago

In order to make the loading message optional in the run_magic_commit() function, I added a new parameter called show_loading_message to the function's signature. This parameter is set to True if the --no-load flag is not provided.

Inside the function, I added a conditional check to determine whether to show the loading animation. If show_loading_message is True, then a new threading event is created and a separate thread is started to run the animate_loading() function. Otherwise, the loading animation is bypassed.

This change allows the loading message to be disabled when it is not needed, providing a cleaner and more flexible user experience.