Skip to content

Commit 689d6ea

Browse files
committed
Fix for failing Promise usage in Svelte markup
1 parent a5968e0 commit 689d6ea

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/components/FeaturesList.svelte

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@
142142
margin-left: 0;
143143
}
144144
}
145-
145+
146146
.support {
147147
text-transform: uppercase;
148148
font-weight: bold;
@@ -207,13 +207,13 @@
207207
<li>
208208
<span><i class="mdi {feature.icon}"></i> <a rel="prefetch" href="/{feature.id}.html">{feature.name}</a></span>
209209
{#await feature.determineIsSupported() then isSupported}
210-
{#if isSupported}
210+
{#if isSupported === true}
211211
<span class="support support-yes">Yes <i class="mdi mdi-check"></i></span>
212-
{:else}
212+
{:else if isSupported === false}
213213
<span class="support support-no">No <i class="mdi mdi-cross"></i></span>
214+
{:else}
215+
<span class="support-unk">not testable</span>
214216
{/if}
215-
{:catch}
216-
<span class="support-unk">not testable</span>
217217
{/await}
218218
</li>
219219
{/each}

src/utils/feature.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ export class Feature {
120120

121121
async determineIsSupported() {
122122
if (!this.tests.length) {
123-
throw 'no tests'
123+
return null
124124
}
125125

126126
const results = await Promise.all(this.tests.map(t => t.result))

0 commit comments

Comments
 (0)