feat(app): make app update notification not close when opening the changelog (#5978)
Make app update notification not close when opening the changelog
This commit is contained in:
@@ -920,6 +920,7 @@ async function checkUpdates() {
|
|||||||
{
|
{
|
||||||
label: formatMessage(updatePopupMessages.changelog),
|
label: formatMessage(updatePopupMessages.changelog),
|
||||||
action: () => openUrl('https://modrinth.com/news/changelog?filter=app'),
|
action: () => openUrl('https://modrinth.com/news/changelog?filter=app'),
|
||||||
|
keepOpen: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
@@ -1002,6 +1003,7 @@ async function downloadUpdate(versionToDownload) {
|
|||||||
{
|
{
|
||||||
label: formatMessage(updatePopupMessages.changelog),
|
label: formatMessage(updatePopupMessages.changelog),
|
||||||
action: () => openUrl('https://modrinth.com/news/changelog?filter=app'),
|
action: () => openUrl('https://modrinth.com/news/changelog?filter=app'),
|
||||||
|
keepOpen: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -130,7 +130,9 @@ const dismiss = (id: string | number) => popupNotificationManager.removeNotifica
|
|||||||
|
|
||||||
function handleButtonClick(id: string | number, btn: PopupNotificationButton) {
|
function handleButtonClick(id: string | number, btn: PopupNotificationButton) {
|
||||||
btn.action()
|
btn.action()
|
||||||
popupNotificationManager.removeNotification(id)
|
if (!btn.keepOpen) {
|
||||||
|
popupNotificationManager.removeNotification(id)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function progressColorForType(type: PopupNotification['type']) {
|
function progressColorForType(type: PopupNotification['type']) {
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ export interface PopupNotificationButton {
|
|||||||
label: string
|
label: string
|
||||||
action: () => void
|
action: () => void
|
||||||
color?: 'brand' | 'red' | 'orange' | 'green' | 'blue' | 'standard'
|
color?: 'brand' | 'red' | 'orange' | 'green' | 'blue' | 'standard'
|
||||||
|
keepOpen?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface PopupNotificationProgressItem {
|
export interface PopupNotificationProgressItem {
|
||||||
|
|||||||
Reference in New Issue
Block a user