fix: markdown editor not working
This commit is contained in:
2 files changed
+12
-11
No files matched your search
@@ -32,7 +32,7 @@
|
|||||||
str: string,
|
str: string,
|
||||||
startIndex: number,
|
startIndex: number,
|
||||||
endIndex: number,
|
endIndex: number,
|
||||||
replacement: string,
|
replacement: string
|
||||||
) {
|
) {
|
||||||
return str.substring(0, startIndex) + replacement + str.substring(endIndex)
|
return str.substring(0, startIndex) + replacement + str.substring(endIndex)
|
||||||
}
|
}
|
||||||
@@ -49,7 +49,7 @@
|
|||||||
textArea.value,
|
textArea.value,
|
||||||
startPos,
|
startPos,
|
||||||
endPos,
|
endPos,
|
||||||
newText,
|
newText
|
||||||
)
|
)
|
||||||
|
|
||||||
textArea.focus()
|
textArea.focus()
|
||||||
@@ -60,7 +60,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
let uploadingImage = $state(false)
|
let uploadingImage = $state(false)
|
||||||
let image: any = $state()
|
let image = $state<any>(null)
|
||||||
|
|
||||||
const shortcuts = {
|
const shortcuts = {
|
||||||
KeyB: () => wrapSelection('**', '**'),
|
KeyB: () => wrapSelection('**', '**'),
|
||||||
|
|||||||
@@ -35,12 +35,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function conversationPreviews(
|
function conversationPreviews(
|
||||||
conversations: PrivateMessageView[],
|
conversations: PrivateMessageView[]
|
||||||
): ConversationPreview[] {
|
): ConversationPreview[] {
|
||||||
const deduplicated = filterDuplicates(
|
const deduplicated = filterDuplicates(conversations, (i) => i.creator.id)
|
||||||
conversations.toReversed(),
|
|
||||||
(i) => i.creator.id,
|
|
||||||
)
|
|
||||||
|
|
||||||
return deduplicated.map((i) => ({
|
return deduplicated.map((i) => ({
|
||||||
user: i.creator,
|
user: i.creator,
|
||||||
@@ -64,7 +61,7 @@
|
|||||||
{:then data}
|
{:then data}
|
||||||
{@const conversations = data.private_messages}
|
{@const conversations = data.private_messages}
|
||||||
{@const previews = conversationPreviews(conversations).filter(
|
{@const previews = conversationPreviews(conversations).filter(
|
||||||
(c) => c.user.id != profile.data?.user?.local_user_view.person.id,
|
(c) => c.user.id != profile.data?.user?.local_user_view.person.id
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<ul
|
<ul
|
||||||
@@ -83,9 +80,13 @@
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Avatar url={preview.user.avatar} alt={preview.user.name} width={32} />
|
<Avatar url={preview.user.avatar} alt={preview.user.name} width={32} />
|
||||||
<div class="flex flex-col">
|
<div class="flex flex-col w-full overflow-hidden">
|
||||||
<div class="font-medium">{preview.user.name}</div>
|
<div class="font-medium">{preview.user.name}</div>
|
||||||
<div class="text-slate-700 dark:text-zinc-300 text-sm">
|
<div
|
||||||
|
class="text-sm overflow-ellipsis whitespace-nowrap
|
||||||
|
bg-gradient-to-r from-slate-700 via-slate-700 to-slate-700/0 dark:from-zinc-300 dark:via-zinc-300 dark:to-zinc-300/0
|
||||||
|
text-transparent bg-clip-text"
|
||||||
|
>
|
||||||
{preview.message.content}
|
{preview.message.content}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in new issue
Block a user