Skip to content

Commit e563385

Browse files
committed
Replicate plan image fix for individual plans
1 parent 9e88ec8 commit e563385

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

src/routes/plans/[id]/+page.svelte

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,17 @@
2828
import { compareVersions } from '$lib/scripts/stringUtils';
2929
3030
const imageFolder =
31-
compareVersions(config.programVersion, '12.0') < 0 ? 'illustrations' : 'plans';
31+
compareVersions(config.programVersion, '12.0') < 0
32+
? import.meta.glob('./*', {
33+
eager: true,
34+
import: 'default',
35+
base: '/src/gen-assets/illustrations'
36+
})
37+
: import.meta.glob(['./*', '!./*.json'], {
38+
eager: true,
39+
import: 'default',
40+
base: '/src/gen-assets/plans'
41+
});
3242
3343
const barIconColor = $s['ui.bar.text-select.icon']['color'];
3444
//need some way to know the status of the plan
@@ -202,7 +212,7 @@
202212
<div>
203213
<img
204214
class="plan-image"
205-
src="{base}/{imageFolder}/{$page.data.planConfig.image.file}"
215+
src={imageFolder[`./${$page.data.planConfig.image.file}`]}
206216
alt={$page.data.planConfig.image.file}
207217
width={$page.data.planConfig.image.width}
208218
height={$page.data.planConfig.image.height}

0 commit comments

Comments
 (0)