title order
This commit is contained in:
parent
d31d154841
commit
b1d49552ae
1 changed files with 3 additions and 3 deletions
|
|
@ -20,9 +20,6 @@ function classNames(...classes) {
|
|||
export function PatternLabel({ pattern } /* : { pattern: Tables<'code'> } */) {
|
||||
const meta = useMemo(() => getMetadata(pattern.code), [pattern]);
|
||||
let title = meta.title;
|
||||
if (title == null) {
|
||||
title == pattern.hash;
|
||||
}
|
||||
if (title == null) {
|
||||
const date = new Date(pattern.created_at);
|
||||
if (isNaN(date)) {
|
||||
|
|
@ -30,6 +27,9 @@ export function PatternLabel({ pattern } /* : { pattern: Tables<'code'> } */) {
|
|||
}
|
||||
title = date.toLocaleDateString();
|
||||
}
|
||||
if (title == null) {
|
||||
title = pattern.hash;
|
||||
}
|
||||
if (title == null) {
|
||||
title = 'unnamed';
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue