refactor(settings): replace getStorageItem with state.global.settings for default root retrieval

This commit is contained in:
Will Miao
2025-09-19 22:57:05 +08:00
parent 1610048974
commit f3544b3471
5 changed files with 17 additions and 225 deletions

View File

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