mirror of
https://github.com/eliasstepanik/strudel.git
synced 2026-01-15 15:48:30 +00:00
title order
This commit is contained in:
parent
d31d154841
commit
b1d49552ae
@ -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…
x
Reference in New Issue
Block a user