Skip to content

A full-featured download manager.

fix: add nullcheck for legacy speed settings (#1417)

Sammyecf59583d6c1
diff --git a/src/renderer/components/Preference/Basic.vue b/src/renderer/components/Preference/Basic.vue
index 601bce50..2ca95668 100644
--- a/src/renderer/components/Preference/Basic.vue
+++ b/src/renderer/components/Preference/Basic.vue
@@ -414,7 +414,10 @@
},
downloadUnits: {
get () {
- const speedEnding = this.form.maxOverallDownloadLimit?.slice(-1)
+ const speed = this.form.maxOverallDownloadLimit
+ // Fallback to K if Speed is 0 (previously unlimited)
+ if (!speed) return 'K'
+ const speedEnding = speed.slice(-1)
// Fall back to KB if the downloadlimit doesnt have a unit
if (!speedEnding || !isNaN(parseInt(speedEnding))) return 'K'
return speedEnding
@@ -425,7 +428,10 @@
},
uploadUnits: {
get () {
- const speedEnding = this.form.maxOverallUploadLimit?.slice(-1)
+ const speed = this.form.maxOverallUploadLimit
+ // Fallback to K if Speed is 0 (previously unlimited)
+ if (!speed) return 'K'
+ const speedEnding = speed.slice(-1)
// Fall back to KB if the downloadlimit doesnt have a unit
if (!speedEnding || !isNaN(parseInt(speedEnding))) return 'K'
return speedEnding