Skip to content

Commit 087a246

Browse files
Code: code improvements done
1 parent f3afbbc commit 087a246

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

components/csvbox/csvbox-new-row/csvbox-new-row.mjs

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import app from "../csvbox.app.mjs";
22

33
export default {
44
key: "csvbox-new-row",
5-
name: "New Import",
5+
name: "Import New Row",
66
description: "Emit new events when a new row is added to a CSVBox sheet",
77
version: "0.0.1",
88
type: "source",
@@ -56,7 +56,6 @@ export default {
5656
ts: Date.now(),
5757
});
5858

59-
6059
this._setSampleRow(first);
6160
} catch (err) {
6261
console.error("Error during source activation:", err);
@@ -89,15 +88,31 @@ export default {
8988
},
9089
},
9190
methods: {
91+
/**
92+
* Retrieves the stored webhook ID from persistent storage
93+
* @returns {string|null} The webhook ID or null if not set
94+
*/
9295
_getHookID() {
9396
return this.db.get("hookId");
9497
},
98+
/**
99+
* Stores the webhook ID in persistent storage
100+
* @param {string|null} hookID - The webhook ID to store
101+
*/
95102
_setHookID(hookID) {
96103
this.db.set("hookId", hookID);
97104
},
105+
/**
106+
* Retrieves the stored sample row data from persistent storage
107+
* @returns {object|null} The sample row data or null if not set
108+
*/
98109
_getSampleRow() {
99110
return this.db.get("sampleRow");
100111
},
112+
/**
113+
* Stores sample row data in persistent storage
114+
* @param {object|null} rowData - The sample row data to store
115+
*/
101116
_setSampleRow(rowData) {
102117
this.db.set("sampleRow", rowData);
103118
},

0 commit comments

Comments
 (0)