Spaces:
Running
Running
Kartik Shetty
commited on
fix: Prompt bypasses login (#921)
Browse filesFixes#879 checking login requirement in chat window
src/lib/components/chat/ChatWindow.svelte
CHANGED
@@ -195,9 +195,30 @@
|
|
195 |
model={currentModel}
|
196 |
/>
|
197 |
{:else if !assistant}
|
198 |
-
<ChatIntroduction
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
199 |
{:else}
|
200 |
-
<AssistantIntroduction
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
201 |
{/if}
|
202 |
</div>
|
203 |
<ScrollToBottomBtn
|
|
|
195 |
model={currentModel}
|
196 |
/>
|
197 |
{:else if !assistant}
|
198 |
+
<ChatIntroduction
|
199 |
+
{models}
|
200 |
+
{currentModel}
|
201 |
+
on:message={(ev) => {
|
202 |
+
if ($page.data.loginRequired) {
|
203 |
+
ev.preventDefault();
|
204 |
+
loginModalOpen = true;
|
205 |
+
} else {
|
206 |
+
dispatch("message", ev.detail);
|
207 |
+
}
|
208 |
+
}}
|
209 |
+
/>
|
210 |
{:else}
|
211 |
+
<AssistantIntroduction
|
212 |
+
{assistant}
|
213 |
+
on:message={(ev) => {
|
214 |
+
if ($page.data.loginRequired) {
|
215 |
+
ev.preventDefault();
|
216 |
+
loginModalOpen = true;
|
217 |
+
} else {
|
218 |
+
dispatch("message", ev.detail);
|
219 |
+
}
|
220 |
+
}}
|
221 |
+
/>
|
222 |
{/if}
|
223 |
</div>
|
224 |
<ScrollToBottomBtn
|