mirror of
https://github.com/zadam/trilium.git
synced 2025-11-10 08:29:00 +01:00
fix(client/type_widgets): empty tab not working when closing last tab
This commit is contained in:
parent
7ba91b7a9d
commit
763fa0b515
@ -265,6 +265,7 @@ export default class TabManager extends Component {
|
||||
mainNtxId: string | null = null
|
||||
): Promise<NoteContext> {
|
||||
const noteContext = new NoteContext(ntxId, hoistedNoteId, mainNtxId);
|
||||
noteContext.setEmpty();
|
||||
|
||||
const existingNoteContext = this.children.find((nc) => nc.ntxId === noteContext.ntxId);
|
||||
|
||||
|
||||
@ -278,6 +278,7 @@ async function getCorrespondingWidget(type: ExtendedNoteType): Promise<null | Ty
|
||||
}
|
||||
|
||||
async function getWidgetType(note: FNote | null | undefined, noteContext: NoteContext | undefined): Promise<ExtendedNoteType | undefined> {
|
||||
if (!noteContext) return undefined;
|
||||
if (!note) {
|
||||
// If the note is null, then it's a new tab. If it's undefined, then it's not loaded yet.
|
||||
return note === null ? "empty" : undefined;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user