Skip to content

Commit eb9c347

Browse files
authored
feat(app): make app update notification not close when opening the changelog (#5978)
Make app update notification not close when opening the changelog
1 parent f857d19 commit eb9c347

3 files changed

Lines changed: 6 additions & 1 deletion

File tree

apps/app-frontend/src/App.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -920,6 +920,7 @@ async function checkUpdates() {
920920
{
921921
label: formatMessage(updatePopupMessages.changelog),
922922
action: () => openUrl('https://modrinth.com/news/changelog?filter=app'),
923+
keepOpen: true,
923924
},
924925
],
925926
})
@@ -1002,6 +1003,7 @@ async function downloadUpdate(versionToDownload) {
10021003
{
10031004
label: formatMessage(updatePopupMessages.changelog),
10041005
action: () => openUrl('https://modrinth.com/news/changelog?filter=app'),
1006+
keepOpen: true,
10051007
},
10061008
],
10071009
})

packages/ui/src/components/nav/PopupNotificationPanel.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,9 @@ const dismiss = (id: string | number) => popupNotificationManager.removeNotifica
130130
131131
function handleButtonClick(id: string | number, btn: PopupNotificationButton) {
132132
btn.action()
133-
popupNotificationManager.removeNotification(id)
133+
if (!btn.keepOpen) {
134+
popupNotificationManager.removeNotification(id)
135+
}
134136
}
135137
136138
function progressColorForType(type: PopupNotification['type']) {

packages/ui/src/providers/popup-notifications.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ export interface PopupNotificationButton {
44
label: string
55
action: () => void
66
color?: 'brand' | 'red' | 'orange' | 'green' | 'blue' | 'standard'
7+
keepOpen?: boolean
78
}
89

910
export interface PopupNotificationProgressItem {

0 commit comments

Comments
 (0)