mirror of
https://gitlab.com/ryzen-controller-team/ryzen-controller.git
synced 2024-12-22 10:03:28 +07:00
fix: Avoid crash when an error exist in upload preset request response.
This commit is contained in:
parent
6ac94535c0
commit
adf7155800
@ -119,6 +119,11 @@ class PresetButtons extends React.Component<PresetButtonsProps, {}> {
|
||||
})
|
||||
);
|
||||
presetsOnlineContext.update();
|
||||
})
|
||||
.catch(() => {
|
||||
NotificationContext.error(
|
||||
getTranslation("presetButtons.uploadError", "An error occured while uploading the preset")
|
||||
);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
@ -104,5 +104,6 @@
|
||||
"appContext.newReleaseAvailable": "有新版本发布,请检查发布标签。",
|
||||
"PresetOnline.errorLoadingPresets": "无法加载预设。",
|
||||
"PresetOnline.retryLoadingPresetListBtn": "重试",
|
||||
"PresetOnline.pleaseCheckInternetConnection": "请检查您的互联网连接。"
|
||||
"PresetOnline.pleaseCheckInternetConnection": "请检查您的互联网连接。",
|
||||
"presetButtons.uploadError": "上载预设时发生错误"
|
||||
}
|
||||
|
@ -104,5 +104,6 @@
|
||||
"appContext.newReleaseAvailable": "Eine neue Version ist verfügbar. Überprüfen Sie die Registerkarte Version.",
|
||||
"PresetOnline.errorLoadingPresets": "Presets können nicht geladen werden.",
|
||||
"PresetOnline.retryLoadingPresetListBtn": "Wiederholen",
|
||||
"PresetOnline.pleaseCheckInternetConnection": "Bitte überprüfe deine Internetverbindung."
|
||||
"PresetOnline.pleaseCheckInternetConnection": "Bitte überprüfe deine Internetverbindung.",
|
||||
"presetButtons.uploadError": "Beim Hochladen der Voreinstellung ist ein Fehler aufgetreten"
|
||||
}
|
||||
|
@ -104,5 +104,6 @@
|
||||
"appContext.newReleaseAvailable": "A new release is available, please check the release tab.",
|
||||
"PresetOnline.errorLoadingPresets": "Unable to load presets.",
|
||||
"PresetOnline.retryLoadingPresetListBtn": "Retry",
|
||||
"PresetOnline.pleaseCheckInternetConnection": "Please check your internet connection."
|
||||
"PresetOnline.pleaseCheckInternetConnection": "Please check your internet connection.",
|
||||
"presetButtons.uploadError": "An error occured while uploading the preset"
|
||||
}
|
||||
|
@ -104,5 +104,6 @@
|
||||
"appContext.newReleaseAvailable": "Une nouvelle version est disponible, vérifiez l'onglet releases.",
|
||||
"PresetOnline.errorLoadingPresets": "Impossible de charger les presets en ligne.",
|
||||
"PresetOnline.retryLoadingPresetListBtn": "Réessayer",
|
||||
"PresetOnline.pleaseCheckInternetConnection": "Veuillez vérifier votre connexion internet."
|
||||
"PresetOnline.pleaseCheckInternetConnection": "Veuillez vérifier votre connexion internet.",
|
||||
"presetButtons.uploadError": "Une erreur est survenu lors de l'upload du preset"
|
||||
}
|
||||
|
@ -104,5 +104,6 @@
|
||||
"appContext.newReleaseAvailable": "Yeni bir sürüm mevcut, lütfen Sürümler sekmesini kontrol edin.",
|
||||
"PresetOnline.errorLoadingPresets": "Ön ayarlar yüklenemiyor.",
|
||||
"PresetOnline.retryLoadingPresetListBtn": "Yeniden Dene",
|
||||
"PresetOnline.pleaseCheckInternetConnection": "Lütfen internet bağlantınızı kontrol edin."
|
||||
"PresetOnline.pleaseCheckInternetConnection": "Lütfen internet bağlantınızı kontrol edin.",
|
||||
"presetButtons.uploadError": "Ön ayar yüklenirken bir hata oluştu"
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ class PresetsScene extends React.Component<{}, PresetsOnlineContextType> {
|
||||
this.isUserAlreadyVotedForThisPreset = this.isUserAlreadyVotedForThisPreset.bind(this);
|
||||
}
|
||||
|
||||
uploadPreset(preset: ApiPreset) {
|
||||
uploadPreset(preset: ApiPreset): Promise<ApiPreset> {
|
||||
const requestOption: RequestInit = {
|
||||
method: "POST",
|
||||
headers: {
|
||||
|
Loading…
Reference in New Issue
Block a user