mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-16 19:57:52 +01:00
mobile: fix tab bugs
This commit is contained in:
committed by
Abdullah Atta
parent
d9521b5058
commit
2ce31fc81c
@@ -33,6 +33,7 @@ import Paragraph from "../../ui/typography/paragraph";
|
||||
type TabItem = {
|
||||
id: number;
|
||||
noteId?: string;
|
||||
previewTab?: boolean;
|
||||
};
|
||||
|
||||
const TabItemComponent = (props: {
|
||||
@@ -59,6 +60,11 @@ const TabItemComponent = (props: {
|
||||
props.close?.();
|
||||
}
|
||||
}}
|
||||
onLongPress={() => {
|
||||
useTabStore.getState().updateTab(props.tab.id, {
|
||||
previewTab: false
|
||||
});
|
||||
}}
|
||||
>
|
||||
<View
|
||||
style={{
|
||||
@@ -73,6 +79,9 @@ const TabItemComponent = (props: {
|
||||
? colors.selected.paragraph
|
||||
: colors.primary.paragraph
|
||||
}
|
||||
style={{
|
||||
fontStyle: props.tab.previewTab ? "italic" : "normal"
|
||||
}}
|
||||
size={SIZE.md}
|
||||
>
|
||||
{item?.title || "New note"}
|
||||
|
||||
@@ -278,7 +278,7 @@ export const useEditor = (
|
||||
}
|
||||
|
||||
if (!locked) {
|
||||
id = await db.notes?.add(noteData);
|
||||
id = await db.notes?.add({ ...noteData });
|
||||
if (!note && id) {
|
||||
editorSessionHistory.newSession(id);
|
||||
if (id) {
|
||||
@@ -300,7 +300,6 @@ export const useEditor = (
|
||||
}
|
||||
|
||||
if (!noteData.title) {
|
||||
console.log("posting title to tab", tabId);
|
||||
postMessage(
|
||||
EditorEvents.title,
|
||||
currentNotes.current[id]?.title,
|
||||
|
||||
Reference in New Issue
Block a user