Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -226,14 +226,21 @@ button.svelte-1lcyrx4[aria-label="user's message: a file of type image/jpeg, "]
|
|
| 226 |
}
|
| 227 |
"""
|
| 228 |
|
| 229 |
-
js = """
|
|
|
|
| 230 |
const url = new URL(window.location);
|
| 231 |
|
|
|
|
| 232 |
if (url.searchParams.get('__theme') !== 'light') {
|
| 233 |
url.searchParams.set('__theme', 'light');
|
| 234 |
-
|
|
|
|
| 235 |
}
|
| 236 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 237 |
|
| 238 |
demo = gr.ChatInterface(
|
| 239 |
fn=chat,
|
|
|
|
| 226 |
}
|
| 227 |
"""
|
| 228 |
|
| 229 |
+
js = """
|
| 230 |
+
function forceLightTheme() {
|
| 231 |
const url = new URL(window.location);
|
| 232 |
|
| 233 |
+
// Cập nhật __theme thành light nếu giá trị không đúng
|
| 234 |
if (url.searchParams.get('__theme') !== 'light') {
|
| 235 |
url.searchParams.set('__theme', 'light');
|
| 236 |
+
// Thay đổi URL mà không tải lại trang nếu cần
|
| 237 |
+
window.history.replaceState({}, '', url.href);
|
| 238 |
}
|
| 239 |
+
|
| 240 |
+
// Đảm bảo document luôn áp dụng theme light
|
| 241 |
+
document.documentElement.setAttribute('data-theme', 'light');
|
| 242 |
+
}
|
| 243 |
+
"""
|
| 244 |
|
| 245 |
demo = gr.ChatInterface(
|
| 246 |
fn=chat,
|