Skip to content
This repository has been archived by the owner on Aug 30, 2022. It is now read-only.

Commit

Permalink
Convert module to json before publishing and fix subscribe callback s…
Browse files Browse the repository at this point in the history
…hape
  • Loading branch information
parzival418 committed Oct 3, 2021
1 parent 8cc4985 commit f5216de
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions client/src/contexts/ModuleProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const ModuleProvider = ({ children }) => {
// Subscribe to all general update module events
// and relay them to the individual module name subscribers
useEffect(() => {
return subscribe(UPDATE_MODULE, module => {
return subscribe(UPDATE_MODULE, (event, module) => {
publish($MODULE_UPDATED(module.name), module)
})
}, [])
Expand All @@ -51,7 +51,7 @@ const ModuleProvider = ({ children }) => {
const module = await models.modules.updateModule(moduleName, update)
if (snack) enqueueSnackbar('Module saved')

publish(UPDATE_MODULE, module)
publish(UPDATE_MODULE, module.toJSON())

return module
} catch (err) {
Expand Down

0 comments on commit f5216de

Please sign in to comment.