fix: router

This commit is contained in:
Jannat Patel
2024-03-19 12:51:11 +05:30
parent 86748b301d
commit f15862cef4
4 changed files with 21 additions and 6 deletions

View File

@@ -3,9 +3,10 @@
"private": true,
"version": "0.0.0",
"scripts": {
"dev": "vite --host",
"build": "vite build",
"preview": "vite preview"
"dev": "vite",
"serve": "vite preview",
"build": "vite build --base=/assets/lms/frontend/ && yarn copy-html-entry",
"copy-html-entry": "cp ../lms/public/frontend/index.html ../lms/www/learning.html"
},
"dependencies": {
"@editorjs/checklist": "^1.6.0",
@@ -34,4 +35,4 @@
"postcss": "^8.4.5",
"vite": "^5.0.11"
}
}
}

View File

@@ -71,6 +71,7 @@ import { MessageSquareIcon } from 'lucide-vue-next'
const showTopics = ref(true)
const currentTopic = ref(null)
const socket = inject('$socket')
const user = inject('$user')
const showTopicModal = ref(false)
const props = defineProps({
@@ -101,6 +102,8 @@ const props = defineProps({
})
onMounted(() => {
if (user.data) topics.reload()
socket.on('new_discussion_topic', (data) => {
topics.refresh()
})
@@ -116,7 +119,6 @@ const topics = createResource({
single_thread: props.singleThread,
}
},
auto: true,
})
const showReplies = (topic) => {

View File

@@ -97,7 +97,7 @@ const routes = [
]
let router = createRouter({
history: createWebHistory('/'),
history: createWebHistory('/learning'),
routes,
})

12
lms/www/learning.py Normal file
View File

@@ -0,0 +1,12 @@
import frappe
from frappe.utils.telemetry import capture
no_cache = 1
def get_context(context):
csrf_token = frappe.sessions.get_csrf_token()
frappe.db.commit()
if frappe.session.user != "Guest":
capture("active_site", "lms")
context.csrf_token = csrf_token