mirror of
https://github.com/ajnart/homarr.git
synced 2026-01-22 15:32:25 +01:00
🐛 RSS empty feed stuck on loading
This commit is contained in:
@@ -62,13 +62,17 @@ export const rssRouter = createTRPCRouter({
|
||||
| IRssWidget
|
||||
| undefined;
|
||||
|
||||
if (!rssWidget || input.feedUrls.length === 0) {
|
||||
if (!rssWidget) {
|
||||
throw new TRPCError({
|
||||
code: 'NOT_FOUND',
|
||||
message: 'required widget does not exist',
|
||||
});
|
||||
}
|
||||
|
||||
if (input.feedUrls.length === 0) {
|
||||
return [{ feed: undefined, success: false }]
|
||||
}
|
||||
|
||||
const result = await Promise.all(
|
||||
input.feedUrls.map(async (feedUrl) =>
|
||||
getFeedUrl(feedUrl, rssWidget.properties.dangerousAllowSanitizedItemContent)
|
||||
|
||||
@@ -100,7 +100,7 @@ function RssTile({ widget }: RssTileProps) {
|
||||
);
|
||||
}
|
||||
|
||||
if (data.length < 1 || !data[0].feed || isError) {
|
||||
if (data.length === 1 && !data[0].feed || isError) {
|
||||
return (
|
||||
<Center h="100%">
|
||||
<Stack align="center">
|
||||
@@ -200,7 +200,7 @@ export const useGetRssFeeds = (
|
||||
// Cache the results for 24 hours
|
||||
cacheTime: 1000 * 60 * 60 * 24,
|
||||
staleTime: 1000 * 60 * refreshInterval,
|
||||
enabled: !!configName,
|
||||
enabled: !!configName || !!feedUrls,
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user