Skip to content

Commit

Permalink
fix(note): banner value is string
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <tukon479@gmail.com>
  • Loading branch information
Innei committed Apr 12, 2023
1 parent eca5a8a commit 751ae05
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/layouts/NoteLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ const useNoteMetaBanner = (note?: NoteModel) => {
if (!banner) {
return
}
banner = { ...banner }
if (typeof banner === 'string') {
return {
type: 'info',
message: banner,
className: bannerClassNames.info,
}
}
banner = { ...banner }
banner.type ??= 'info'
banner.className ??= bannerClassNames[banner.type]

Expand Down

0 comments on commit 751ae05

Please sign in to comment.