Skip to content

Commit 59f3545

Browse files
committed
fix default template id
1 parent 41086ee commit 59f3545

File tree

1 file changed

+3
-10
lines changed
  • hub/src/routes/n/[nook]/template/[templateId]

1 file changed

+3
-10
lines changed

hub/src/routes/n/[nook]/template/[templateId]/edit.tsx

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
import { type JSX, Show } from 'solid-js'
22
import { EditTemplate } from 'shared-dom/editTemplate'
33
import { defaultRenderContainer } from '~/lib/utility'
4-
import {
5-
cast,
6-
type NookId,
7-
type RemoteTemplateId,
8-
type TemplateId,
9-
} from 'shared/brand'
4+
import { cast, type NookId, type RemoteTemplateId } from 'shared/brand'
105
import {
116
type Template,
127
getDefaultTemplate as getDefaultTemplateOg,
@@ -22,9 +17,7 @@ import { getUserId } from '~/session'
2217
import { useThemeContext } from 'shared-dom/themeSelector'
2318
import { useIsModContext } from '~/components/isModContext'
2419
import { cwaClient } from '~/routes/cwaClient'
25-
26-
const getDefaultTemplate = () =>
27-
getDefaultTemplateOg(crypto.randomUUID() as TemplateId) // highTODO
20+
import { base64urlId } from 'shared/binary'
2821

2922
const saveButton = (template: { template: Template }) => (
3023
<button
@@ -91,7 +84,7 @@ export default function Edit(props: RouteSectionProps): JSX.Element {
9184
<Show when={isMod()} fallback={<>You're not a mod.</>}>
9285
<Show when={template()}>
9386
<EditTemplate
94-
getDefaultTemplate={getDefaultTemplate}
87+
getDefaultTemplate={() => getDefaultTemplateOg(base64urlId())}
9588
saveButton={saveButton}
9689
theme={theme()}
9790
template={template()!}

0 commit comments

Comments
 (0)