Fix type error with fileId not being set
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
# Clementine
|
# Clementine
|
||||||
|
|
||||||
Clementine is a no-frills, self-hosted plain text editor.
|
Clementine is a no-frills, self-hosted plain text editor.
|
||||||
It doesn't do fancy Markdown formatting or hyperlinks, though you can certainly still use it to write Markdown!
|
It doesn't do fancy Markdown formatting or hyperlinks, though you can certainly still use it to write Markdown!
|
||||||
All it does is get out of your way and give you a place to type.
|
All it does is get out of your way and give you a place to type.
|
||||||
@@ -8,6 +9,7 @@ Users beware: Clementine is currently at a very early stage of development!
|
|||||||
I can't guarantee it won't eat your work, and it (just barely) meets my own needs.
|
I can't guarantee it won't eat your work, and it (just barely) meets my own needs.
|
||||||
|
|
||||||
## Planned features
|
## Planned features
|
||||||
|
|
||||||
Clementine is already architected to be offline-friendly: all data is in IndexedDB.
|
Clementine is already architected to be offline-friendly: all data is in IndexedDB.
|
||||||
It's not a proper PWA yet, so you do need an internet connection on mobile in order to initially load the page.
|
It's not a proper PWA yet, so you do need an internet connection on mobile in order to initially load the page.
|
||||||
But once loaded, no further connection is needed.
|
But once loaded, no further connection is needed.
|
||||||
|
|||||||
@@ -17,9 +17,12 @@ import { useNavbar } from './App';
|
|||||||
import { useParams } from '@solidjs/router';
|
import { useParams } from '@solidjs/router';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import { closeDoc, getDocStats, openDoc } from '../persistence';
|
import { closeDoc, getDocStats, openDoc } from '../persistence';
|
||||||
|
import { assert } from '../util';
|
||||||
|
|
||||||
function Editor() {
|
function Editor() {
|
||||||
const { id: fileId } = useParams();
|
const { id: fileId } = useParams();
|
||||||
|
assert(fileId, 'Editor component loaded without a file');
|
||||||
|
|
||||||
const { setFileId, setNumUpdates } = useNavbar();
|
const { setFileId, setNumUpdates } = useNavbar();
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
setFileId(fileId);
|
setFileId(fileId);
|
||||||
|
|||||||
Reference in New Issue
Block a user