@learnpack/learnpack 5.0.240 → 5.0.244

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -13,7 +13,7 @@ const NotificationListener: React.FC<NotificationListenerProps> = ({
13
13
  onNotification,
14
14
  }) => {
15
15
  useEffect(() => {
16
- console.log("NOTIFICATION ID listening", notificationId)
16
+
17
17
  if (!notificationId) return
18
18
 
19
19
  socketClient.connect()
@@ -13,7 +13,6 @@ import {
13
13
  // reWriteTitle,
14
14
  useConsumableCall,
15
15
  isValidRigoToken,
16
- fixTitleLength,
17
16
  } from "../../utils/lib"
18
17
 
19
18
  import Loader from "../Loader"
@@ -96,25 +95,23 @@ const SyllabusEditor: React.FC = () => {
96
95
  return
97
96
  }
98
97
 
99
- let slug = slugify(syllabus.courseInfo.title)
100
- let newTitle = syllabus.courseInfo.title
101
- let isAvailable = await isSlugAvailable(slug)
98
+ let newSlug = syllabus.courseInfo.slug
99
+ let isAvailable = await isSlugAvailable(syllabus.courseInfo.slug)
102
100
 
103
101
  while (!isAvailable) {
104
- if (newTitle.length > 50) {
105
- newTitle = newTitle.slice(0, 44)
102
+ if (newSlug.length > 50) {
103
+ newSlug = newSlug.slice(0, 44)
106
104
  }
107
- newTitle = newTitle + "-" + randomUUID()
108
- newTitle = newTitle.slice(0, 50)
109
- slug = slugify(newTitle)
110
- isAvailable = await isSlugAvailable(slug)
105
+ newSlug = newSlug + "-" + randomUUID()
106
+ newSlug = newSlug.slice(0, 50)
107
+ isAvailable = await isSlugAvailable(newSlug)
111
108
  }
112
109
 
113
110
  push({
114
111
  ...syllabus,
115
112
  courseInfo: {
116
113
  ...syllabus.courseInfo,
117
- title: newTitle,
114
+ slug: newSlug,
118
115
  },
119
116
  })
120
117
  }
@@ -230,6 +227,8 @@ const SyllabusEditor: React.FC = () => {
230
227
 
231
228
  if (!syllabus) return null
232
229
 
230
+ console.log(syllabus.courseInfo)
231
+
233
232
  return isGenerating ? (
234
233
  <>
235
234
  <Loader
@@ -253,8 +252,7 @@ It may take a moment..."
253
252
  lessons: lessons,
254
253
  courseInfo: {
255
254
  ...syllabus.courseInfo,
256
- title:
257
- fixTitleLength(res.parsed.title) || syllabus.courseInfo.title,
255
+ title: res.parsed.title || syllabus.courseInfo.title,
258
256
  description:
259
257
  res.parsed.description || syllabus.courseInfo.description,
260
258
  language:
@@ -11,6 +11,7 @@ export type FormState = {
11
11
  hasContentIndex: boolean
12
12
  contentIndex: string
13
13
  purpose: string
14
+ slug: string
14
15
  language?: string
15
16
  isCompleted: boolean
16
17
  variables: string[]
@@ -85,6 +86,7 @@ const useStore = create<Store>()(
85
86
  formState: {
86
87
  description: "",
87
88
  duration: 0,
89
+ slug: "",
88
90
  hasContentIndex: false,
89
91
  contentIndex: "",
90
92
  purpose: "",
@@ -119,6 +121,7 @@ const useStore = create<Store>()(
119
121
  resetFormState: () =>
120
122
  set({
121
123
  formState: {
124
+ slug: "",
122
125
  currentStep: "description",
123
126
  description: "",
124
127
  duration: 0,
@@ -169,7 +172,7 @@ const useStore = create<Store>()(
169
172
  formState: {
170
173
  description: "",
171
174
  duration: 0,
172
-
175
+ slug: "",
173
176
  language: "en",
174
177
  technologies: [],
175
178
  hasContentIndex: false,