Revert "port tab manager to ts"

This reverts commit 45a50f3aa1.
This commit is contained in:
Elian Doran
2025-03-03 23:34:54 +02:00
parent 3f641c98fb
commit 3855f0e75f
9 changed files with 152 additions and 228 deletions

View File

@@ -66,13 +66,12 @@ export default class Entrypoints extends Component {
}
async toggleNoteHoistingCommand({ noteId = appContext.tabManager.getActiveContextNoteId() }) {
const activeNoteContext = appContext.tabManager.getActiveContext();
if (!activeNoteContext || !noteId) {
if (!noteId) {
return;
}
const noteToHoist = await froca.getNote(noteId);
const activeNoteContext = appContext.tabManager.getActiveContext();
if (noteToHoist?.noteId === activeNoteContext.hoistedNoteId) {
await activeNoteContext.unhoist();
@@ -84,11 +83,6 @@ export default class Entrypoints extends Component {
async hoistNoteCommand({ noteId }: { noteId: string }) {
const noteContext = appContext.tabManager.getActiveContext();
if (!noteContext) {
logError("hoistNoteCommand: noteContext is null");
return;
}
if (noteContext.hoistedNoteId !== noteId) {
await noteContext.setHoistedNoteId(noteId);
}
@@ -180,11 +174,7 @@ export default class Entrypoints extends Component {
}
async runActiveNoteCommand() {
const noteContext = appContext.tabManager.getActiveContext();
if (!noteContext) {
return;
}
const { ntxId, note } = noteContext;
const { ntxId, note } = appContext.tabManager.getActiveContext();
// ctrl+enter is also used elsewhere, so make sure we're running only when appropriate
if (!note || note.type !== "code") {