Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix what's new popup and show it for each user if enabled #1556

Merged
merged 7 commits into from
Dec 7, 2023
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
4 changes: 2 additions & 2 deletions components/WhatsNewDialog.bs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ sub init()

m.top.id = "OKDialog"
m.top.height = 900
m.top.title = "What's New?"
m.top.title = m.global.app.version + " - " + tr("What's New?")
cewert marked this conversation as resolved.
Show resolved Hide resolved
m.top.buttons = [tr("OK")]

dialogStyles = {
Expand All @@ -21,7 +21,7 @@ sub init()
}
}

whatsNewList = ParseJSON(ReadAsciiFile("pkg:/source/static/whatsNew.json"))
whatsNewList = ParseJSON(ReadAsciiFile("pkg:/source/static/whatsNew/" + m.global.app.version.ToStr().trim() + ".json"))

for each item in whatsNewList
textLine = m.content.CreateChild("StdDlgMultiStyleTextItem")
Expand Down
5 changes: 5 additions & 0 deletions locale/en_US/translations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1241,5 +1241,10 @@
<translation>Make the arrangement of the Roku home view sections match the web client's home screen. Jellyfin will need to be closed and reopened for change to take effect.</translation>
<extracomment>User Setting - Setting description</extracomment>
</message>
<message>
<source>What's New?</source>
<translation>What's New?</translation>
<extracomment>Popup title - Popup displays all the major changes to the app since the last version</extracomment>
</message>
</context>
</TS>
19 changes: 11 additions & 8 deletions source/Main.bs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@ sub Main (args as dynamic) as void
m.wasMigrated = false
runGlobalMigrations()
runRegistryUserMigrations()
' update LastRunVersion now that migrations are finished
showWhatsNew = false
' update global LastRunVersion now that migrations are finished
if m.global.app.version <> m.global.app.lastRunVersion
showWhatsNew = true
set_setting("LastRunVersion", m.global.app.version)
end if
if m.wasMigrated then printRegistry()
Expand Down Expand Up @@ -74,11 +72,16 @@ sub Main (args as dynamic) as void
end if
end if

' Show the Whats New popup
if showWhatsNew and m.global.session.user.settings["load.allowwhatsnew"]
dialog = createObject("roSGNode", "WhatsNewDialog")
m.scene.dialog = dialog
m.scene.dialog.observeField("buttonSelected", m.port)
' has the current user ran this version before?
usersLastRunVersion = m.global.session.user.settings.lastRunVersion
if not isValid(usersLastRunVersion) or not versionChecker(m.global.session.user.settings.lastRunVersion, m.global.app.version)
set_user_setting("LastRunVersion", m.global.app.version)
' show what's new popup
if m.global.session.user.settings["load.allowwhatsnew"]
dialog = createObject("roSGNode", "WhatsNewDialog")
m.scene.dialog = dialog
m.scene.dialog.observeField("buttonSelected", m.port)
end if
end if

' Handle input messages
Expand Down
2 changes: 1 addition & 1 deletion source/migrations.bs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ sub runRegistryUserMigrations()
' app versions < 2.0.0 didn't save LastRunVersion at the user level
' fall back to using the apps lastRunVersion
lastRunVersion = m.global.app.lastRunVersion
registry_write("LastRunVersion", m.global.app.version, section)
registry_write("LastRunVersion", lastRunVersion, section)
end if

' BASE_MIGRATION
Expand Down
182 changes: 0 additions & 182 deletions source/static/whatsNew.json

This file was deleted.

Loading