Skip to content
This repository was archived by the owner on Jul 28, 2025. It is now read-only.

Commit 0e9f5c2

Browse files
committed
issue 29 fixed
1 parent c253528 commit 0e9f5c2

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

docs/changelog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
## 0.2.1
2+
*Published on 2022/05/08*
23
### Improved
34
- Now when you press enter inside a text cell, it will ends the modification with onBlur event.
45
### No longer broken
56
- Create a column now adjust width automatically.
67
- total width of columns not broken anymore. This bug was introduced in 0.2.0
8+
- Frontmatter fields that are not in the schema and were empty will not be insert a null value if a database field is updated. [ISSUE#29](https://github.com/RafaelGB/obsidian-db-folder/issues/29)
79
## 0.2.0
810
*Published on 2022/05/07*
911
### Shiny new things

src/components/reducers/DatabaseDispatch.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,14 +119,20 @@ export function databaseReducer(state: TableDataType, action: ActionType) {
119119
skipReset: { $set: true },
120120
// Modify column visually with the new label
121121
columns: {
122-
[update_column_label_index]: {
123-
$merge: {
122+
$set: [
123+
...state.columns.slice(0, update_column_label_index),
124+
{
125+
...state.columns[update_column_label_index],
124126
label: action.label,
125127
id: action.newKey,
126128
key: action.newKey,
127129
accessor: action.newKey,
128130
},
129-
},
131+
...state.columns.slice(
132+
update_column_label_index + 1,
133+
state.columns.length
134+
),
135+
],
130136
},
131137
// Modify data visually with the new key
132138
data: {

src/parsers/RowDatabaseFieldsToFile.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export const parseFrontmatterFieldsToString = (databaseFields: RowDatabaseFields
1717
// add frontmatter fields that are not specified as database fields
1818
// check if frontmatter field is inside inline fields
1919
if (!inlineFields.hasOwnProperty(key) && !frontmatterFields[key] && key !== deletedColumn) {
20-
array.push(`${key}: ${yaml[key]}`);
20+
array.push(`${key}: ${yaml[key] ?? ''}`);
2121
}
2222
});
2323
}

0 commit comments

Comments
 (0)