atmosphere explorer
0
fork

Configure Feed

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

use fallback instead of await using

Juliet eeef1738 2f01af89

+20 -18
+20 -18
src/views/car.tsx
··· 103 103 } 104 104 } 105 105 106 - // Now parse records using fromStream 107 - const stream = file.stream(); 108 - await using repo = fromStream(stream); 109 - 110 106 const collections = new Map<string, RecordEntry[]>(); 111 107 const result: Archive = { 112 108 file, ··· 114 110 entries: [], 115 111 }; 116 112 117 - for await (const entry of repo) { 118 - let list = collections.get(entry.collection); 119 - if (list === undefined) { 120 - collections.set(entry.collection, (list = [])); 121 - result.entries.push({ 122 - name: entry.collection, 123 - entries: list, 113 + const stream = file.stream(); 114 + const repo = fromStream(stream); 115 + try { 116 + for await (const entry of repo) { 117 + let list = collections.get(entry.collection); 118 + if (list === undefined) { 119 + collections.set(entry.collection, (list = [])); 120 + result.entries.push({ 121 + name: entry.collection, 122 + entries: list, 123 + }); 124 + } 125 + 126 + const record = toJsonValue(entry.record); 127 + list.push({ 128 + key: entry.rkey, 129 + cid: entry.cid.$link, 130 + record, 124 131 }); 125 132 } 126 - 127 - const record = toJsonValue(entry.record); 128 - list.push({ 129 - key: entry.rkey, 130 - cid: entry.cid.$link, 131 - record, 132 - }); 133 + } finally { 134 + await repo.dispose(); 133 135 } 134 136 135 137 setArchive(result);