From f535c5c1ab18c1daf10f681dbf13017b214fc99f Mon Sep 17 00:00:00 2001 From: sawka Date: Mon, 19 Aug 2024 18:33:52 -0700 Subject: [PATCH] default file to ~ --- frontend/app/view/preview/preview.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/app/view/preview/preview.tsx b/frontend/app/view/preview/preview.tsx index 00d1412f5..fda095a72 100644 --- a/frontend/app/view/preview/preview.tsx +++ b/frontend/app/view/preview/preview.tsx @@ -190,7 +190,11 @@ export class PreviewModel implements ViewModel { }); this.fileName = jotai.atom( (get) => { - return get(this.blockAtom)?.meta?.file; + const file = get(this.blockAtom)?.meta?.file; + if (util.isBlank(file)) { + return "~"; + } + return file; }, (get, set, update) => { services.ObjectService.UpdateObjectMeta(`block:${blockId}`, { file: update });