Show update indicator on version header (#1069)

This commit is contained in:
boatbomber
2025-06-20 19:53:45 -07:00
committed by GitHub
parent 951f0cda0b
commit 60f19df9a0
5 changed files with 143 additions and 42 deletions

View File

@@ -251,27 +251,10 @@ function App:closeNotification(id: number)
end
function App:checkForUpdates()
if not Settings:get("checkForUpdates") then
return
end
local updateMessage = Version.getUpdateMessage()
local isLocalInstall = string.find(debug.traceback(), "\n[^\n]-user_.-$") ~= nil
local latestCompatibleVersion = Version.retrieveLatestCompatible({
version = Config.version,
includePrereleases = isLocalInstall and Settings:get("checkForPrereleases"),
})
if not latestCompatibleVersion then
return
end
self:addNotification(
string.format(
"A newer compatible version of Rojo, %s, was published %s! Go to the Rojo releases page to learn more.",
Version.display(latestCompatibleVersion.version),
timeUtil.elapsedToText(DateTime.now().UnixTimestamp - latestCompatibleVersion.publishedUnixTimestamp)
),
500,
{
if updateMessage then
self:addNotification(updateMessage, 500, {
Dismiss = {
text = "Dismiss",
style = "Bordered",
@@ -280,8 +263,8 @@ function App:checkForUpdates()
notification:dismiss()
end,
},
}
)
})
end
end
function App:getPriorSyncInfo(): { host: string?, port: string?, projectName: string?, timestamp: number? }