Skip to content

fix: update fetch calls for main games and library data loading#50

Merged
zortos293 merged 1 commit intoOpenCloudGaming:mainfrom
Kief5555:main
Dec 27, 2025
Merged

fix: update fetch calls for main games and library data loading#50
zortos293 merged 1 commit intoOpenCloudGaming:mainfrom
Kief5555:main

Conversation

@Kief5555
Copy link
Contributor

Description

Related Issue

Fixes #

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement
  • CI/CD changes

Platform Tested

  • macOS
  • Windows
  • Linux

Checklist

  • My code follows the project's coding style
  • I have tested my changes locally
  • I have added/updated documentation as needed
  • My changes don't introduce new warnings
  • I have checked that there aren't other open PRs for the same issue

Screenshots (if applicable)

Additional Notes

Copilot AI review requested due to automatic review settings December 27, 2025 22:44
@zortos293 zortos293 merged commit 43254d9 into OpenCloudGaming:main Dec 27, 2025
4 checks passed
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR swaps the priority of data fetching methods for the home view and adds a complete implementation for the library view data loading. The changes prioritize fetching from the main games panel first, falling back to the library when needed.

Key Changes:

  • Swapped fetch order in loadHomeData() to try fetch_main_games first, then fall back to fetch_library
  • Implemented the previously empty loadLibraryData() function with proper loading placeholders and API calls
  • Updated all console log messages and comments to reflect the new fetch order

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

renderGamesGrid("my-games", []);
}
} catch (error) {
console.error("Failed to load library data:", error);
Copy link

Copilot AI Dec 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When the library fetch fails, the placeholders are not cleared. This leaves the user seeing placeholder content instead of an indication that the library failed to load or is empty. Consider clearing the placeholders or showing an error message to provide better user feedback.

Suggested change
console.error("Failed to load library data:", error);
console.error("Failed to load library data:", error);
// Clear loading placeholders on error
renderGamesGrid("recently-played", []);
renderGamesGrid("my-games", []);
// Show a simple error message so the user knows the library failed to load
const recentlyPlayedEl = document.getElementById("recently-played");
if (recentlyPlayedEl) {
recentlyPlayedEl.innerHTML =
'<div class="empty-state error-state">Failed to load recently played games.</div>';
}
const myGamesEl = document.getElementById("my-games");
if (myGamesEl) {
myGamesEl.innerHTML =
'<div class="empty-state error-state">Failed to load your library.</div>';
}

Copilot uses AI. Check for mistakes.
Comment on lines +3189 to +3190
try {
const accessToken = await invoke<string>("get_gfn_jwt");
Copy link

Copilot AI Dec 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function doesn't check if the user is authenticated before attempting to fetch library data. If a user navigates to the library view while not authenticated, the call to get_gfn_jwt will fail. Consider adding an authentication check similar to loadHomeData, which checks isAuthenticated and displays appropriate UI (like a login prompt) when the user is not authenticated.

Copilot uses AI. Check for mistakes.
zortos293 added a commit that referenced this pull request Feb 21, 2026
fix: update fetch calls for main games and library data loading
zortos293 added a commit that referenced this pull request Feb 21, 2026
fix: update fetch calls for main games and library data loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants