mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-06-05 03:30:03 +00:00
SchemeDownloader: add support for spaces in names
This commit is contained in:
@@ -241,9 +241,14 @@ Popup {
|
||||
// Rate limit hit - try to use cache if available
|
||||
downloadError = I18n.tr("settings.color-scheme.download.error.rate-limit");
|
||||
Logger.w("ColorSchemeDownload", downloadError);
|
||||
if (schemesCacheAdapter.schemes && schemesCacheAdapter.schemes.length > 0) {
|
||||
availableSchemes = schemesCacheAdapter.schemes;
|
||||
Logger.i("ColorSchemeDownload", "Using cached schemes due to rate limit");
|
||||
if (typeof ShellState !== 'undefined' && ShellState.isLoaded) {
|
||||
const cacheData = ShellState.getColorSchemesList();
|
||||
const cachedSchemes = cacheData.schemes || [];
|
||||
if (cachedSchemes.length > 0) {
|
||||
availableSchemes = cachedSchemes;
|
||||
hasInitialData = true;
|
||||
Logger.i("ColorSchemeDownload", "Using cached schemes due to rate limit");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
downloadError = I18n.tr("settings.color-scheme.download.error.api-error", {
|
||||
@@ -740,7 +745,12 @@ Popup {
|
||||
enabled: !fetching && !downloading
|
||||
onClicked: {
|
||||
// Force refresh by clearing cache timestamp and fetching directly from API
|
||||
schemesCacheAdapter.timestamp = 0;
|
||||
if (typeof ShellState !== 'undefined' && ShellState.isLoaded) {
|
||||
ShellState.setColorSchemesList({
|
||||
schemes: [],
|
||||
timestamp: 0
|
||||
});
|
||||
}
|
||||
// Fetch directly from API to avoid cache check delay
|
||||
fetchAvailableSchemesFromAPI();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user