Fix account attribute access in timeline view
Replace references to 'id' with 'account_id' to match AccountManager's Account model. This resolves the "Active account missing id attribute" error and enables proper account tracking for timeline functionality. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -136,7 +136,7 @@ class TimelineView(QTreeWidget):
|
||||
"""Handle account switching with proper post ID tracking"""
|
||||
# Get the new account ID to track post IDs per account
|
||||
active_account = self.account_manager.get_active_account()
|
||||
new_account_id = active_account.id if active_account and hasattr(active_account, 'id') else None
|
||||
new_account_id = active_account.account_id if active_account and hasattr(active_account, 'account_id') else None
|
||||
|
||||
# If account changed, reset newest_post_id tracking
|
||||
if new_account_id != self.current_account_id:
|
||||
@@ -155,7 +155,7 @@ class TimelineView(QTreeWidget):
|
||||
|
||||
# Check if we have proper post tracking for the current account
|
||||
active_account = self.account_manager.get_active_account()
|
||||
current_account_id = active_account.id if active_account and hasattr(active_account, 'id') else None
|
||||
current_account_id = active_account.account_id if active_account and hasattr(active_account, 'account_id') else None
|
||||
|
||||
# If account changed but we haven't reset tracking yet, suppress until reset
|
||||
if current_account_id != self.current_account_id:
|
||||
@@ -293,10 +293,10 @@ class TimelineView(QTreeWidget):
|
||||
self.logger.debug(f"Active account type: {type(active_account)}")
|
||||
if active_account:
|
||||
self.logger.debug(f"Active account attributes: {dir(active_account)}")
|
||||
if hasattr(active_account, 'id'):
|
||||
self.current_account_id = active_account.id
|
||||
if hasattr(active_account, 'account_id'):
|
||||
self.current_account_id = active_account.account_id
|
||||
else:
|
||||
self.logger.error(f"Active account missing id attribute: {active_account}")
|
||||
self.logger.error(f"Active account missing account_id attribute: {active_account}")
|
||||
self.current_account_id = None
|
||||
else:
|
||||
self.current_account_id = None
|
||||
|
Reference in New Issue
Block a user