mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-10-03 20:53:09 +00:00
fix: make /api/version endpoint respect channel query parameter
- Add support for ?channel=stable or ?channel=rc query parameter to /api/version - This enables frontend channel switching preview functionality - Aligns /api/version behavior with /api/updates/check endpoint - Fixes issue where channel switching in settings UI didn't work properly
This commit is contained in:
+6
-3
@@ -741,10 +741,13 @@ app.get('/api/version', async (req, res) => {
|
||||
let updateAvailable = false;
|
||||
|
||||
try {
|
||||
// Try to check for updates, but don't fail if it doesn't work
|
||||
const updateInfo = await updateManager.checkForUpdates();
|
||||
// Check for channel override from query parameter (for preview functionality)
|
||||
const channelOverride = req.query.channel;
|
||||
|
||||
// Try to check for updates with optional channel override
|
||||
const updateInfo = await updateManager.checkForUpdates(channelOverride);
|
||||
latestVersion = updateInfo.latestVersion || currentVersion;
|
||||
updateAvailable = updateInfo.hasUpdate || false;
|
||||
updateAvailable = updateInfo.updateAvailable || false;
|
||||
} catch (updateError) {
|
||||
// Log the error but continue with current version info
|
||||
console.error("[Version API] Error checking for updates:", updateError.message);
|
||||
|
||||
Reference in New Issue
Block a user