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

Commit 6f59ff1

Browse files
committed
cleaning
1 parent d2b7ff1 commit 6f59ff1

File tree

5 files changed

+2
-193
lines changed

5 files changed

+2
-193
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
"@mui/material": "5.9.3",
5454
"@mui/icons-material": "5.8.4",
5555
"@popperjs/core": "2.11.5",
56-
"immutability-helper": "3.1.1",
5756
"monkey-around": "2.3.0",
5857
"pkg.json": "2.0.8",
5958
"obsidian-dataview": "0.5.41",

src/components/index/Database.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
import React, { useEffect, useReducer } from "react";
1+
import React from "react";
22
import { Table } from "components/Table";
33
import { TableDataType } from "cdm/FolderModel";
4-
import { databaseReducer } from "components/reducers/DatabaseDispatch";
5-
import { ActionTypes } from "helpers/Constants";
64
import useTableStore from "components/reducers/TableReducer";
75
export function createDatabase(tableProps: TableDataType): JSX.Element {
86
return <Database {...tableProps} />;

src/components/reducers/DatabaseDispatch.tsx

Lines changed: 0 additions & 110 deletions
This file was deleted.

src/main.ts

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -261,24 +261,6 @@ export default class DBFolderPlugin extends Plugin {
261261
registerMonkeyPatches() {
262262
const self = this;
263263

264-
this.app.workspace.onLayoutReady(() => {
265-
this.register(
266-
around((app as any).commands, {
267-
executeCommandById(next) {
268-
return function (command: string) {
269-
const view = app.workspace.getActiveViewOfType(DatabaseView);
270-
271-
if (view) {
272-
//view.emitter.emit('hotkey', command);
273-
}
274-
275-
return next.call(this, command);
276-
};
277-
},
278-
})
279-
);
280-
});
281-
282264
// Monkey patch WorkspaceLeaf to open Databases with DatabaseView by default
283265
this.register(
284266
around(WorkspaceLeaf.prototype, {

src/stateManagement/useDataStore.ts

Lines changed: 1 addition & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -155,64 +155,4 @@ const useDataStore = (view: DatabaseView) => {
155155

156156
);
157157
}
158-
export default useDataStore;
159-
/**
160-
* case ActionTypes.UPDATE_COLUMN_LABEL:
161-
const update_column_label_index = state.view.columns.findIndex(
162-
(column: any) => column.id === action.columnId
163-
);
164-
165-
// Update configuration & row files on disk
166-
state.view.diskConfig.updateColumnKey(
167-
action.columnId,
168-
action.newKey,
169-
action.label
170-
);
171-
// Promise.all(
172-
// state.view.rows.map(async (row: RowDataType) => {
173-
// await updateRowFileProxy(
174-
// row.__note__.getFile(),
175-
// action.columnId,
176-
// action.newKey,
177-
// action.state,
178-
// UpdateRowOptions.COLUMN_KEY
179-
// );
180-
// })
181-
// );
182-
return update(state, {
183-
skipReset: { $set: true },
184-
// Modify column visually with the new label
185-
view: {
186-
columns: {
187-
$set: [
188-
...state.view.columns.slice(0, update_column_label_index),
189-
{
190-
...state.view.columns[update_column_label_index],
191-
label: action.label,
192-
id: action.newKey,
193-
key: action.newKey,
194-
accessorKey: action.newKey,
195-
},
196-
...state.view.columns.slice(
197-
update_column_label_index + 1,
198-
state.view.columns.length
199-
),
200-
],
201-
},
202-
// Modify data visually with the new key
203-
rows: {
204-
$set: state.view.rows.map((row: RowDataType) => {
205-
row[action.newKey] = row[action.columnId];
206-
delete row[action.columnId];
207-
return row;
208-
}),
209-
},
210-
// Update view yaml state
211-
diskConfig: {
212-
yaml: {
213-
$set: state.view.diskConfig.yaml,
214-
},
215-
},
216-
},
217-
});
218-
*/
158+
export default useDataStore;

0 commit comments

Comments
 (0)