Skip to content

Commit c86b8c8

Browse files
committed
fix: increase the timeout for actions that may trigger feed refresh
1 parent 263f2fb commit c86b8c8

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

frontend/src/lib/api/feed.ts

+3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export async function getFeed(id: number) {
1313
export async function checkValidity(link: string) {
1414
const resp = await api
1515
.post('feeds/validation', {
16+
timeout: 20000,
1617
json: { link: link }
1718
})
1819
.json<{ feed_links: { title: string; link: string }[] }>();
@@ -27,6 +28,7 @@ export async function createFeed(data: {
2728
return { name: v.name, link: v.link };
2829
});
2930
return await api.post('feeds', {
31+
timeout: 20000,
3032
json: { feeds: feeds, group_id: data.group_id }
3133
});
3234
}
@@ -50,6 +52,7 @@ export async function deleteFeed(id: number) {
5052

5153
export async function refreshFeeds(options: { id?: number; all?: boolean }) {
5254
return await api.post('feeds/refresh', {
55+
timeout: 20000,
5356
json: {
5457
id: options.id,
5558
all: options.all

frontend/src/routes/feeds/ActionAdd.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
toast.promise(checkValidity(formData.link), {
4545
loading: 'Waiting for validating and sniffing ' + formData.link,
4646
success: (resp) => {
47+
loading = false;
4748
// resp = [
4849
// { title: 'test1', link: 'https://test1/1.xml' },
4950
// { title: 'test2', link: 'https://test2/2.xml' }
@@ -79,7 +80,6 @@
7980
}
8081
invalidateAll();
8182
open = false;
82-
loading = false;
8383
}
8484
</script>
8585

0 commit comments

Comments
 (0)