dont load item if null

This commit is contained in:
ammarahm-ed
2020-12-31 13:42:53 +05:00
parent 8e090e39f3
commit 0d6aa1189a

View File

@@ -63,22 +63,7 @@ export const ActionSheetComponent = ({
const {colors, premiumUser, user} = state;
const [refreshing, setRefreshing] = useState(false);
const [isPinnedToMenu, setIsPinnedToMenu] = useState(false);
const [note, setNote] = useState(
item
? item
: {
colors: [],
tags: [],
pinned: false,
favorite: false,
locked: false,
content: {
text: null,
delta: null,
},
dateCreated: null,
},
);
const [note, setNote] = useState(item);
function changeColorScheme(colors = COLOR_SCHEME, accent = ACCENT) {
let newColors = setColorScheme(colors, accent);
@@ -739,7 +724,7 @@ export const ActionSheetComponent = ({
<ActionSheetColorsSection close={close} item={note} />
) : null}
{hasTags ? (
{hasTags && note ? (
<ActionSheetTagsSection
close={close}
item={note}