mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-16 18:26:20 +01:00
💡 Address PR comments
This commit is contained in:
@@ -247,14 +247,14 @@ const WidgetOptionTypeSwitch: FC<{
|
||||
case 'multiple-text':
|
||||
return (
|
||||
<MultiSelect
|
||||
data={value.map((v: any) => ({ value: v, label: v }))}
|
||||
data={value.map((name: any) => ({ value: name, label: name }))}
|
||||
label={t(`descriptor.settings.${key}.label`)}
|
||||
description={t(`descriptor.settings.${key}.description`)}
|
||||
defaultValue={value as string[]}
|
||||
withinPortal
|
||||
searchable
|
||||
creatable
|
||||
getCreateLabel={(query) => `+ Add ${query}`}
|
||||
getCreateLabel={(query) => t('common:createItem', query)}
|
||||
onChange={(values) =>
|
||||
handleChange(
|
||||
key,
|
||||
|
||||
@@ -50,7 +50,7 @@ export const Get = async (request: NextApiRequest, response: NextApiResponse) =>
|
||||
return;
|
||||
}
|
||||
|
||||
Consola.info('Requesting RSS feed...');
|
||||
Consola.info(`Requesting RSS feed at url ${parseResult.data.feedUrl}`);
|
||||
const stopWatch = new Stopwatch();
|
||||
const feed = await parser.parseURL(parseResult.data.feedUrl);
|
||||
Consola.info(`Retrieved RSS feed after ${stopWatch.getEllapsedMilliseconds()} milliseconds`);
|
||||
|
||||
@@ -33,10 +33,10 @@ const definition = defineWidget({
|
||||
},
|
||||
refreshInterval: {
|
||||
type: 'slider',
|
||||
defaultValue: 60,
|
||||
min: 30,
|
||||
defaultValue: 30,
|
||||
min: 15,
|
||||
max: 300,
|
||||
step: 30,
|
||||
step: 15,
|
||||
},
|
||||
},
|
||||
gridstack: {
|
||||
@@ -59,7 +59,7 @@ export const useGetRssFeeds = (feedUrls: string[], refreshInterval: number, widg
|
||||
queryKey: ['rss-feeds', feedUrls],
|
||||
// Cache the results for 24 hours
|
||||
cacheTime: 1000 * 60 * 60 * 24,
|
||||
staleTime: 1000 * refreshInterval,
|
||||
staleTime: 1000 * 60 * refreshInterval,
|
||||
queryFn: async () => {
|
||||
const responses = await Promise.all(
|
||||
feedUrls.map((feedUrl) =>
|
||||
@@ -86,7 +86,6 @@ function RssTile({ widget }: RssTileProps) {
|
||||
try {
|
||||
const inputDate = dayjs(new Date(input));
|
||||
const now = dayjs(); // Current date and time
|
||||
// The difference between the input date and now
|
||||
const difference = now.diff(inputDate, 'ms');
|
||||
const duration = dayjs.duration(difference, 'ms');
|
||||
const humanizedDuration = duration.humanize();
|
||||
|
||||
Reference in New Issue
Block a user