Skip to content

Commit

Permalink
Fix Create object button not available (#125)
Browse files Browse the repository at this point in the history
  • Loading branch information
levipro authored Feb 20, 2023
1 parent 7da4dec commit 0073b8e
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,21 @@ type PropertyType = {
schema: SortedObjectSchema;
};

const emptyRealmObject: DeserializedRealmObject = { realmObject: {} };

export const ObjectAdd = ({ schema }: PropertyType) => {
const { addObject } = usePlugin(plugin);

const [values, setValues] = useState<DeserializedRealmObject | null>(null);
const [values, setValues] = useState<DeserializedRealmObject>(emptyRealmObject);
const [visible, setVisible] = useState(false);

const showModal = () => {
setValues(null);
setValues(emptyRealmObject);
setVisible(true);
};

const hideModal = () => {
setValues(null);
setValues(emptyRealmObject);
setVisible(false);
};

Expand Down

0 comments on commit 0073b8e

Please sign in to comment.