Anpassung Aktivitäts-UI
Dieser Commit ist enthalten in:
@ -668,18 +668,18 @@ pause
|
||||
# Update UI optimistically immediately
|
||||
self.update_activity_status(False)
|
||||
|
||||
success = activity_service.stop_activity()
|
||||
success = activity_service.stop_activity(self.project.name)
|
||||
|
||||
logger.info(f"Activity stop result: success={success}")
|
||||
|
||||
if not success:
|
||||
# Revert on failure - check if we're still the active project
|
||||
current = activity_service.get_current_activity()
|
||||
if current and current.get('projectName') == self.project.name:
|
||||
current = activity_service.get_current_activity(self.project.name)
|
||||
if current:
|
||||
logger.error(f"Failed to stop activity for {self.project.name}, reverting UI")
|
||||
self.update_activity_status(True, activity_service.user_name, True)
|
||||
else:
|
||||
logger.error(f"Failed to stop activity, but no current activity found")
|
||||
logger.error(f"Failed to stop activity, project not found in active list")
|
||||
|
||||
def _toggle_activity(self):
|
||||
"""Toggle activity for this project"""
|
||||
@ -705,9 +705,7 @@ pause
|
||||
)
|
||||
return
|
||||
|
||||
current_activity = activity_service.get_current_activity()
|
||||
is_this_project_active = (current_activity and
|
||||
current_activity.get('projectName') == self.project.name)
|
||||
is_this_project_active = activity_service.is_project_active_for_user(self.project.name)
|
||||
|
||||
logger.info(f"Current activity status: {is_this_project_active}")
|
||||
|
||||
@ -872,11 +870,9 @@ pause
|
||||
logger.debug(f"check_activity called for project: {self.project.name}")
|
||||
|
||||
# First check if this is our own current activity
|
||||
current_activity = activity_service.get_current_activity()
|
||||
is_own_current = (current_activity and
|
||||
current_activity.get('projectName') == self.project.name)
|
||||
is_own_current = activity_service.is_project_active_for_user(self.project.name)
|
||||
|
||||
logger.debug(f"Current activity check - is_own_current: {is_own_current}, current_activity: {current_activity}")
|
||||
logger.debug(f"Current activity check - is_own_current: {is_own_current}")
|
||||
|
||||
# Get all activities for this project from server
|
||||
active_users = []
|
||||
|
||||
In neuem Issue referenzieren
Einen Benutzer sperren