mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
fix: Error when you try to edit a course from a button
This commit is contained in:
parent
f524ddb51a
commit
0fb213ee4e
7 changed files with 22 additions and 17 deletions
|
|
@ -25,7 +25,7 @@ interface EditorWrapperProps {
|
|||
|
||||
function EditorWrapper(props: EditorWrapperProps): JSX.Element {
|
||||
const session = useLHSession() as any
|
||||
const access_token = session?.data?.tokens?.access_token;
|
||||
const access_token = session?.data?.tokens?.access_token;
|
||||
// Define provider in the state
|
||||
const [provider, setProvider] = React.useState<HocuspocusProvider | null>(null);
|
||||
const [thisPageColor, setThisPageColor] = useState(randomColor({ luminosity: 'light' }) as string)
|
||||
|
|
@ -51,7 +51,7 @@ function EditorWrapper(props: EditorWrapperProps): JSX.Element {
|
|||
}, 10);
|
||||
};
|
||||
|
||||
|
||||
|
||||
// Store the Y document in the browser
|
||||
new IndexeddbPersistence(props.activity.activity_uuid, doc)
|
||||
|
||||
|
|
@ -80,7 +80,7 @@ function EditorWrapper(props: EditorWrapperProps): JSX.Element {
|
|||
}
|
||||
});
|
||||
|
||||
toast.promise(updateActivity(activity, activity.activity_uuid,access_token), {
|
||||
toast.promise(updateActivity(activity, activity.activity_uuid, access_token), {
|
||||
loading: 'Saving...',
|
||||
success: <b>Activity saved!</b>,
|
||||
error: <b>Could not save.</b>,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue