feat(themes): persist publisher id in theme manifests
Publishing now stamps the signed-in EZPPFarm user ID into theme.json and saves it before packaging, so installed theme cards can resolve avatars by stable user ID. Older manifests keep the author-name fallback.
This commit is contained in:
1 parent
5eea428802
commit
11aefee7ed
4 files changed
+35
-6
No files matched your search
@@ -422,6 +422,14 @@
|
||||
return ownedWorkshopThemeNames.includes(theme.name.trim().toLowerCase());
|
||||
};
|
||||
|
||||
const themeAuthorAvatarUrl = (theme: Theme) => {
|
||||
if (theme.authorId && theme.authorId > 0) {
|
||||
return `https://a.ez-pp.farm/${theme.authorId}`;
|
||||
}
|
||||
const author = theme.author.trim();
|
||||
return author ? `https://a.ez-pp.farm/${encodeURIComponent(author)}` : undefined;
|
||||
};
|
||||
|
||||
onMount(() => {
|
||||
let loadedUserId: number | undefined;
|
||||
return currentUser.subscribe((user) => {
|
||||
@@ -4073,9 +4081,7 @@
|
||||
class="size-5 shrink-0 border border-white/20 bg-theme-800"
|
||||
>
|
||||
<Avatar.Image
|
||||
src={theme.author.trim()
|
||||
? `https://a.ez-pp.farm/${encodeURIComponent(theme.author.trim())}`
|
||||
: undefined}
|
||||
src={themeAuthorAvatarUrl(theme)}
|
||||
alt={theme.author || 'Unknown author'}
|
||||
class="object-cover"
|
||||
/>
|
||||
|
||||
Reference in new issue
Block a user