pstream is dead; long live pstream taciturnaxolotl.github.io/pstream-ng/
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix backend selector loading forever

Pas fd79b97b ef1a0893

+17 -5
+17 -5
src/components/form/BackendSelector.tsx
··· 140 140 })); 141 141 setBackendOptions(options); 142 142 143 - const promises = options.map(async (option) => { 143 + // Fetch each backend's meta independently and update state as each completes 144 + // This prevents one slow/down backend from blocking the others 145 + options.forEach(async (option) => { 144 146 try { 145 147 const meta = await getBackendMeta(option.url); 146 - return { ...option, meta, loading: false, error: false }; 148 + setBackendOptions((prev) => 149 + prev.map((opt) => 150 + opt.url === option.url 151 + ? { ...opt, meta, loading: false, error: false } 152 + : opt, 153 + ), 154 + ); 147 155 } catch { 148 - return { ...option, meta: null, loading: false, error: true }; 156 + setBackendOptions((prev) => 157 + prev.map((opt) => 158 + opt.url === option.url 159 + ? { ...opt, meta: null, loading: false, error: true } 160 + : opt, 161 + ), 162 + ); 149 163 } 150 164 }); 151 - const results = await Promise.all(promises); 152 - setBackendOptions(results); 153 165 }; 154 166 155 167 if (availableUrls.length > 0) {