refac
This commit is contained in:
1 parent
d7513e4ce8
commit
b4d13793a3
6 files changed
+13
-2
No files matched your search
@@ -3881,6 +3881,7 @@
|
|||||||
{mergeResponses}
|
{mergeResponses}
|
||||||
{chatActionHandler}
|
{chatActionHandler}
|
||||||
{addMessages}
|
{addMessages}
|
||||||
|
allowDelete={!(generating || taskIds?.length)}
|
||||||
forkHandler={generating || taskIds?.length ? null : handleForkChat}
|
forkHandler={generating || taskIds?.length ? null : handleForkChat}
|
||||||
topPadding={!embedded}
|
topPadding={!embedded}
|
||||||
bottomPadding={files.length > 0}
|
bottomPadding={files.length > 0}
|
||||||
|
|||||||
@@ -43,6 +43,7 @@
|
|||||||
export let forkHandler: Function | null = null;
|
export let forkHandler: Function | null = null;
|
||||||
|
|
||||||
export let readOnly = false;
|
export let readOnly = false;
|
||||||
|
export let allowDelete = true;
|
||||||
export let compactPreview = false;
|
export let compactPreview = false;
|
||||||
export let editCodeBlock = true;
|
export let editCodeBlock = true;
|
||||||
|
|
||||||
@@ -555,6 +556,7 @@
|
|||||||
{mergeResponses}
|
{mergeResponses}
|
||||||
{addMessages}
|
{addMessages}
|
||||||
{forkHandler}
|
{forkHandler}
|
||||||
|
{allowDelete}
|
||||||
{triggerScroll}
|
{triggerScroll}
|
||||||
{readOnly}
|
{readOnly}
|
||||||
{compactPreview}
|
{compactPreview}
|
||||||
|
|||||||
@@ -42,6 +42,7 @@
|
|||||||
export let forkHandler: Function | null = null;
|
export let forkHandler: Function | null = null;
|
||||||
export let triggerScroll;
|
export let triggerScroll;
|
||||||
export let readOnly = false;
|
export let readOnly = false;
|
||||||
|
export let allowDelete = true;
|
||||||
export let compactPreview = false;
|
export let compactPreview = false;
|
||||||
export let editCodeBlock = true;
|
export let editCodeBlock = true;
|
||||||
export let topPadding = false;
|
export let topPadding = false;
|
||||||
@@ -76,6 +77,7 @@
|
|||||||
{showNextMessage}
|
{showNextMessage}
|
||||||
{editMessage}
|
{editMessage}
|
||||||
{deleteMessage}
|
{deleteMessage}
|
||||||
|
{allowDelete}
|
||||||
{readOnly}
|
{readOnly}
|
||||||
{compactPreview}
|
{compactPreview}
|
||||||
{editCodeBlock}
|
{editCodeBlock}
|
||||||
@@ -101,6 +103,7 @@
|
|||||||
{actionMessage}
|
{actionMessage}
|
||||||
{submitMessage}
|
{submitMessage}
|
||||||
{deleteMessage}
|
{deleteMessage}
|
||||||
|
{allowDelete}
|
||||||
{continueResponse}
|
{continueResponse}
|
||||||
{regenerateResponse}
|
{regenerateResponse}
|
||||||
{addMessages}
|
{addMessages}
|
||||||
@@ -126,6 +129,7 @@
|
|||||||
{actionMessage}
|
{actionMessage}
|
||||||
{submitMessage}
|
{submitMessage}
|
||||||
{deleteMessage}
|
{deleteMessage}
|
||||||
|
{allowDelete}
|
||||||
{continueResponse}
|
{continueResponse}
|
||||||
{regenerateResponse}
|
{regenerateResponse}
|
||||||
{mergeResponses}
|
{mergeResponses}
|
||||||
|
|||||||
@@ -28,6 +28,7 @@
|
|||||||
|
|
||||||
export let isLastMessage;
|
export let isLastMessage;
|
||||||
export let readOnly = false;
|
export let readOnly = false;
|
||||||
|
export let allowDelete = true;
|
||||||
export let compactPreview = false;
|
export let compactPreview = false;
|
||||||
export let editCodeBlock = true;
|
export let editCodeBlock = true;
|
||||||
|
|
||||||
@@ -377,6 +378,7 @@
|
|||||||
{saveMessage}
|
{saveMessage}
|
||||||
{rateMessage}
|
{rateMessage}
|
||||||
{deleteMessage}
|
{deleteMessage}
|
||||||
|
{allowDelete}
|
||||||
{actionMessage}
|
{actionMessage}
|
||||||
{submitMessage}
|
{submitMessage}
|
||||||
{continueResponse}
|
{continueResponse}
|
||||||
|
|||||||
@@ -165,6 +165,7 @@
|
|||||||
|
|
||||||
export let isLastMessage = true;
|
export let isLastMessage = true;
|
||||||
export let readOnly = false;
|
export let readOnly = false;
|
||||||
|
export let allowDelete = true;
|
||||||
export let compactPreview = false;
|
export let compactPreview = false;
|
||||||
export let editCodeBlock = true;
|
export let editCodeBlock = true;
|
||||||
export let topPadding = false;
|
export let topPadding = false;
|
||||||
@@ -1482,7 +1483,7 @@
|
|||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{#if $user?.role === 'admin' || ($user?.permissions?.chat?.delete_message ?? true)}
|
{#if $user?.role === 'admin' || ($user?.permissions?.chat?.delete_message ?? true)}
|
||||||
{#if siblings.length > 1}
|
{#if allowDelete && siblings.length > 1}
|
||||||
<Tooltip content={$i18n.t('Delete')} placement="bottom">
|
<Tooltip content={$i18n.t('Delete')} placement="bottom">
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
|
|||||||
@@ -39,6 +39,7 @@
|
|||||||
|
|
||||||
export let isFirstMessage: boolean;
|
export let isFirstMessage: boolean;
|
||||||
export let readOnly: boolean;
|
export let readOnly: boolean;
|
||||||
|
export let allowDelete = true;
|
||||||
export let compactPreview = false;
|
export let compactPreview = false;
|
||||||
export let editCodeBlock = true;
|
export let editCodeBlock = true;
|
||||||
export let topPadding = false;
|
export let topPadding = false;
|
||||||
@@ -578,7 +579,7 @@
|
|||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{#if $_user?.role === 'admin' || ($_user?.permissions?.chat?.delete_message ?? false)}
|
{#if $_user?.role === 'admin' || ($_user?.permissions?.chat?.delete_message ?? false)}
|
||||||
{#if !compactPreview && !readOnly && (!isFirstMessage || siblings.length > 1)}
|
{#if !compactPreview && !readOnly && allowDelete && (!isFirstMessage || siblings.length > 1)}
|
||||||
<Tooltip content={$i18n.t('Delete')} placement="bottom">
|
<Tooltip content={$i18n.t('Delete')} placement="bottom">
|
||||||
<button
|
<button
|
||||||
class="{($settings?.highContrastMode ?? false)
|
class="{($settings?.highContrastMode ?? false)
|
||||||
|
|||||||
Reference in new issue
Block a user