Skip to content

Commit

Permalink
fix(bookmark): improve handling of generator return values in Bookmar…
Browse files Browse the repository at this point in the history
…kProvider
  • Loading branch information
odinr committed Jan 24, 2025
1 parent 8a084c0 commit 0cb2218
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/modules/bookmark/src/BookmarkProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -438,8 +438,7 @@ export class BookmarkProvider implements IBookmarkProvider {
`bookmark data generator ${generator.name} returned a value, but it should not do this, since the data is an immer draft object`,
);
// Dirty fix since some developers are returning the reference object, which will freeze the object
return JSON.parse(JSON.stringify(result));
// return castDraft(result);
return castDraft(JSON.parse(JSON.stringify(result)));
}

// clear the bookmark data if the generator returns null
Expand Down

0 comments on commit 0cb2218

Please sign in to comment.