fix: crash when selecting flairs
This commit is contained in:
2 files changed
+3
-3
No files matched your search
@@ -266,8 +266,8 @@
|
|||||||
{#each data.community.flair_list as flair}
|
{#each data.community.flair_list as flair}
|
||||||
{@const selected = data.flair_list?.some((i) => i == flair.id)}
|
{@const selected = data.flair_list?.some((i) => i == flair.id)}
|
||||||
<button
|
<button
|
||||||
class="rounded-full cursor-pointer hover:brightness-100"
|
class="rounded-full cursor-pointer hover:brightness-100 badge-tag-color"
|
||||||
style="background-color: {flair.background_color};"
|
style="--tag-color: {flair.background_color}; --tag-text-color: {flair.text_color};"
|
||||||
onclick={() => {
|
onclick={() => {
|
||||||
if (selected) {
|
if (selected) {
|
||||||
const index = data.flair_list.findIndex((i) => i == flair.id)
|
const index = data.flair_list.findIndex((i) => i == flair.id)
|
||||||
@@ -320,7 +320,6 @@
|
|||||||
|
|
||||||
data.community = c
|
data.community = c
|
||||||
}}
|
}}
|
||||||
class="w-max"
|
|
||||||
/>
|
/>
|
||||||
{:else}
|
{:else}
|
||||||
<div class="flex flex-col gap-1">
|
<div class="flex flex-col gap-1">
|
||||||
|
|||||||
@@ -35,6 +35,7 @@
|
|||||||
nsfw: false,
|
nsfw: false,
|
||||||
title: '',
|
title: '',
|
||||||
url: undefined,
|
url: undefined,
|
||||||
|
flair_list: [],
|
||||||
}}
|
}}
|
||||||
passedCommunity={community}
|
passedCommunity={community}
|
||||||
onsubmit={(e) => goto(`/post/${e.post.id}`)}
|
onsubmit={(e) => goto(`/post/${e.post.id}`)}
|
||||||
|
|||||||
Reference in new issue
Block a user