Merge pull request #794 from ente-io/integrate-mute-update-notification-api
integrate mute update notification API
This commit is contained in:
commit
3a37be3e4f
|
@ -148,7 +148,9 @@ export default function App({ Component, err }) {
|
|||
if (isElectron()) {
|
||||
const showUpdateDialog = (updateInfo: AppUpdateInfo) => {
|
||||
if (updateInfo.autoUpdatable) {
|
||||
setDialogMessage(getUpdateReadyToInstallMessage());
|
||||
setDialogMessage(
|
||||
getUpdateReadyToInstallMessage(updateInfo)
|
||||
);
|
||||
} else {
|
||||
setNotificationAttributes({
|
||||
endIcon: <ArrowForward />,
|
||||
|
|
|
@ -21,9 +21,14 @@ class ElectronUpdateService {
|
|||
}
|
||||
}
|
||||
|
||||
skipAppVersion(version: string) {
|
||||
if (this.electronAPIs?.skipAppVersion) {
|
||||
this.electronAPIs.skipAppVersion(version);
|
||||
skipAppUpdate(version: string) {
|
||||
if (this.electronAPIs?.skipAppUpdate) {
|
||||
this.electronAPIs.skipAppUpdate(version);
|
||||
}
|
||||
}
|
||||
muteUpdateNotification(version: string) {
|
||||
if (this.electronAPIs?.muteUpdateNotification) {
|
||||
this.electronAPIs.muteUpdateNotification(version);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -77,7 +77,7 @@ export interface ElectronAPIs {
|
|||
showUpdateDialog: (updateInfo: AppUpdateInfo) => void
|
||||
) => void;
|
||||
updateAndRestart: () => void;
|
||||
skipAppVersion: (version: string) => void;
|
||||
skipAppUpdate: (version: string) => void;
|
||||
getSentryUserID: () => Promise<string>;
|
||||
getAppVersion: () => Promise<string>;
|
||||
runFFmpegCmd: (
|
||||
|
@ -85,6 +85,7 @@ export interface ElectronAPIs {
|
|||
inputFile: File | ElectronFile,
|
||||
outputFileName: string
|
||||
) => Promise<File>;
|
||||
muteUpdateNotification: (version: string) => void;
|
||||
generateImageThumbnail: (
|
||||
inputFile: File | ElectronFile,
|
||||
maxDimension: number,
|
||||
|
|
|
@ -46,16 +46,20 @@ export const getTrashFileMessage = (deleteFileHelper): DialogBoxAttributes => ({
|
|||
close: { text: constants.CANCEL },
|
||||
});
|
||||
|
||||
export const getUpdateReadyToInstallMessage = (): DialogBoxAttributes => ({
|
||||
export const getUpdateReadyToInstallMessage = (
|
||||
updateInfo: AppUpdateInfo
|
||||
): DialogBoxAttributes => ({
|
||||
icon: <AutoAwesomeOutlinedIcon />,
|
||||
title: constants.UPDATE_AVAILABLE,
|
||||
content: constants.UPDATE_INSTALLABLE_MESSAGE,
|
||||
close: {
|
||||
text: constants.INSTALL_ON_NEXT_LAUNCH,
|
||||
variant: 'secondary',
|
||||
action: () => ElectronUpdateService.updateAndRestart(),
|
||||
},
|
||||
proceed: {
|
||||
action: () => ElectronUpdateService.updateAndRestart(),
|
||||
action: () =>
|
||||
ElectronUpdateService.muteUpdateNotification(updateInfo.version),
|
||||
text: constants.INSTALL_NOW,
|
||||
variant: 'accent',
|
||||
},
|
||||
|
@ -70,7 +74,7 @@ export const getUpdateAvailableForDownloadMessage = (
|
|||
close: {
|
||||
text: constants.IGNORE_THIS_VERSION,
|
||||
variant: 'secondary',
|
||||
action: () => ElectronUpdateService.skipAppVersion(updateInfo.version),
|
||||
action: () => ElectronUpdateService.skipAppUpdate(updateInfo.version),
|
||||
},
|
||||
proceed: {
|
||||
action: downloadApp,
|
||||
|
|
Loading…
Reference in a new issue