@@ -470,27 +470,49 @@ const initializeAppServer = async () => {
470470 * @async
471471 * @returns {Promise<void> }
472472 */
473+
473474const checkForUpdates = async ( ) => {
474- const betaUserStatus = await getBetaUserStatusFromKeytar ( )
475+ /**
476+ * Indicates whether the current user is a beta user.
477+ * If true, the application will check for pre-release (beta) updates.
478+ * If false, the application will check for stable updates.
479+ */
480+ const betaUserStatus = true
475481
476- // Set autoUpdater feed URL based on beta user status
477482 if ( betaUserStatus ) {
483+ // Configure autoUpdater to check for pre-release updates if the user is a beta user.
478484 autoUpdater . setFeedURL ( {
479- provider : "github" ,
480- owner : "existence-master" ,
481- repo : "Sentient-Beta-Releases"
485+ provider : "github" , // Specify the update provider as GitHub
486+ owner : "existence-master" , // The owner of the GitHub repository
487+ repo : "Sentient" // The name of the GitHub repository
482488 } )
489+
490+ /**
491+ * Allows autoUpdater to check for and download pre-release versions (e.g., beta, alpha).
492+ * This is set to true for beta users to receive beta updates.
493+ */
494+ autoUpdater . allowPrerelease = true
483495 } else {
496+ // Configure autoUpdater to check for stable releases if the user is not a beta user.
484497 autoUpdater . setFeedURL ( {
485- provider : "github" ,
486- owner : "existence-master" ,
487- repo : "Sentient-Releases"
498+ provider : "github" , // Specify the update provider as GitHub
499+ owner : "existence-master" , // The owner of the GitHub repository
500+ repo : "Sentient" // The name of the GitHub repository
488501 } )
502+ // autoUpdater.allowPrerelease is not set here, which defaults to false, ensuring only stable releases are checked.
489503 }
490504
491- createAppWindow ( ) // Create the main application window
492-
493- // autoUpdater.checkForUpdatesAndNotify() // Check for updates and notify user (currently disabled)
505+ /**
506+ * Creates the main application window.
507+ * This should be called after setting up the update feed to ensure the app window is ready regardless of update status.
508+ */
509+ createAppWindow ( )
510+
511+ /**
512+ * Initiates the update check process and notifies the user if an update is available.
513+ * This asynchronous call checks for updates based on the configured feed URL and displays a notification to the user.
514+ */
515+ autoUpdater . checkForUpdatesAndNotify ( )
494516}
495517
496518/**
0 commit comments