fix: correct default root key generation by using singular model type

This commit is contained in:
Will Miao
2025-08-13 11:06:39 +08:00
parent 5a0b3470f1
commit 20ce0778a0

View File

@@ -296,7 +296,8 @@ export class DownloadManager {
).join('');
// Set default root if available
const defaultRootKey = `default_${this.apiClient.modelType}_root`;
const singularType = this.apiClient.modelType.replace(/s$/, '');
const defaultRootKey = `default_${singularType}_root`;
const defaultRoot = getStorageItem('settings', {})[defaultRootKey];
console.log(`Default root for ${this.apiClient.modelType}:`, defaultRoot);
console.log('Available roots:', rootsData.roots);