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

Commit 2f9ccf0

Browse files
committed
Merge branch '593-bug-creating-a-new-note-on-the-first-click-on-a-link-after-importing-from-csv'
2 parents bb3696b + 400f148 commit 2f9ccf0

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

src/helpers/Constants.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,8 @@ export const StyleVariables = Object.freeze({
255255
INPUT_SHADOW: 'var(--input-shadow)',
256256
});
257257

258+
259+
258260
export const SourceDataTypes = Object.freeze({
259261
CURRENT_FOLDER: 'current_folder',
260262
CURRENT_FOLDER_WITHOUT_SUBFOLDERS: 'current_folder_without_subfolders',

src/parsers/NormalizeRowsToCSV.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function sanitizeDataCSV(rows: Row<RowDataType>[]): object[] {
1616
switch (cellKey) {
1717
case MetadataColumns.FILE:
1818
rowObject = updateFromPartial(rowObject, {
19-
[cellKey]: (cellValue as Link).fileName()
19+
[cellKey]: (cellValue as Link).path
2020
});
2121
break;
2222
default:

src/stateManagement/data/handlers/SaveDataFromFileHandlerAction.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,11 @@ export default class SaveDataFromFileHandlerAction extends AbstractTableAction<D
4545
const rows: RowDataType[] = [];
4646
const lines = csv.toString().split("\n");
4747
const headers = this.normalizeArray(lines[0].split(","));
48-
const isCurrentFolder = config.source_data in [SourceDataTypes.CURRENT_FOLDER, SourceDataTypes.CURRENT_FOLDER_WITHOUT_SUBFOLDERS];
48+
const localSources = [
49+
SourceDataTypes.CURRENT_FOLDER,
50+
SourceDataTypes.CURRENT_FOLDER_WITHOUT_SUBFOLDERS
51+
] as string[];
52+
const isCurrentFolder = localSources.contains(config.source_data);
4953
const destination_folder = isCurrentFolder ? view.file.parent.path : config.source_destination_path;
5054
// Obtain File from headers array
5155
const fileIndex = headers.indexOf(
@@ -54,7 +58,6 @@ export default class SaveDataFromFileHandlerAction extends AbstractTableAction<D
5458
if (fileIndex === -1) {
5559
throw new Error(`${view.plugin.settings.global_settings.csv_file_header_key} column not found in CSV file`);
5660
}
57-
5861
for (let i = 1; i < lines.length; i++) {
5962

6063
const currentline = this.normalizeArray(lines[i].split(","));

0 commit comments

Comments
 (0)