Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,10 @@ def check_configurator_update(self):
if donotnotify:
return

release = updater.GithubRelease.get_latest_release(updater.GUIREPO)
try:
release = updater.GithubRelease.get_latest_release(updater.GUIREPO)
except Exception:
return # No internet — silently skip update check
if not release:
return
releaseversion,_ = updater.GithubRelease.get_version(release)
Expand Down Expand Up @@ -1076,7 +1079,8 @@ def process_events():
window.setWindowTitle(PyQt6.QtCore.QCoreApplication.translate("MainUi", "Open FFBoard Configurator"))
window.setWindowIcon(PyQt6.QtGui.QIcon(helper.res_path('app.ico')))
window.show()
window.check_configurator_update() # Check for updates after window is shown
# Defer update check so UI loads instantly even without internet
PyQt6.QtCore.QTimer.singleShot(2000, window.check_configurator_update)
window.autoconnect()

exit_code = app.exec()
Expand Down
2 changes: 1 addition & 1 deletion updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def get_latest_release(repo : str):
"""Returns the latest release for repo or empty dict on error"""
url = f"https://api.github.com/repos/{repo}/releases/latest"
try:
response = requests.get(url,timeout=3) # timeout to avoid blocking when board connecting
response = requests.get(url,timeout=1) # 1s timeout to avoid blocking startup
except requests.ConnectionError:
return {}
if not response:
Expand Down
Loading