Allow retry on shared conversations (#839)
Browse files
src/lib/components/chat/ChatMessage.svelte
CHANGED
@@ -240,36 +240,39 @@
|
|
240 |
</div>
|
241 |
{/if}
|
242 |
</div>
|
243 |
-
{#if
|
244 |
<div
|
245 |
class="absolute bottom-1 right-0 -mb-4 flex max-md:transition-all md:bottom-0 md:group-hover:visible md:group-hover:opacity-100
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
>
|
250 |
-
|
251 |
-
|
|
|
252 |
{message.score && message.score > 0
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
|
|
263 |
{message.score && message.score < 0
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
|
|
273 |
<button
|
274 |
class="btn rounded-sm p-1 text-sm text-gray-400 focus:ring-0 hover:text-gray-500 dark:text-gray-400 dark:hover:text-gray-300"
|
275 |
title="Retry"
|
|
|
240 |
</div>
|
241 |
{/if}
|
242 |
</div>
|
243 |
+
{#if !loading && message.content}
|
244 |
<div
|
245 |
class="absolute bottom-1 right-0 -mb-4 flex max-md:transition-all md:bottom-0 md:group-hover:visible md:group-hover:opacity-100
|
246 |
+
{message.score ? 'visible opacity-100' : 'invisible max-md:-translate-y-4 max-md:opacity-0'}
|
247 |
+
{isTapped || isCopied ? 'max-md:visible max-md:translate-y-0 max-md:opacity-100' : ''}
|
248 |
+
"
|
249 |
>
|
250 |
+
{#if isAuthor}
|
251 |
+
<button
|
252 |
+
class="btn rounded-sm p-1 text-sm text-gray-400 focus:ring-0 hover:text-gray-500 dark:text-gray-400 dark:hover:text-gray-300
|
253 |
{message.score && message.score > 0
|
254 |
+
? 'text-green-500 hover:text-green-500 dark:text-green-400 hover:dark:text-green-400'
|
255 |
+
: ''}"
|
256 |
+
title={message.score === 1 ? "Remove +1" : "+1"}
|
257 |
+
type="button"
|
258 |
+
on:click={() =>
|
259 |
+
dispatch("vote", { score: message.score === 1 ? 0 : 1, id: message.id })}
|
260 |
+
>
|
261 |
+
<CarbonThumbsUp class="h-[1.14em] w-[1.14em]" />
|
262 |
+
</button>
|
263 |
+
<button
|
264 |
+
class="btn rounded-sm p-1 text-sm text-gray-400 focus:ring-0 hover:text-gray-500 dark:text-gray-400 dark:hover:text-gray-300
|
265 |
{message.score && message.score < 0
|
266 |
+
? 'text-red-500 hover:text-red-500 dark:text-red-400 hover:dark:text-red-400'
|
267 |
+
: ''}"
|
268 |
+
title={message.score === -1 ? "Remove -1" : "-1"}
|
269 |
+
type="button"
|
270 |
+
on:click={() =>
|
271 |
+
dispatch("vote", { score: message.score === -1 ? 0 : -1, id: message.id })}
|
272 |
+
>
|
273 |
+
<CarbonThumbsDown class="h-[1.14em] w-[1.14em]" />
|
274 |
+
</button>
|
275 |
+
{/if}
|
276 |
<button
|
277 |
class="btn rounded-sm p-1 text-sm text-gray-400 focus:ring-0 hover:text-gray-500 dark:text-gray-400 dark:hover:text-gray-300"
|
278 |
title="Retry"
|