Append a new row (writes to server, then pushes locally).
(row: FoldrRow)
| 131 | |
| 132 | /** Append a new row (writes to server, then pushes locally). */ |
| 133 | async push(row: FoldrRow): Promise<this> { |
| 134 | await this.initIfNeeded(row); |
| 135 | const res = await this.postCsv(row.link, row.title); |
| 136 | const command = extractCommand(res); |
| 137 | if (typeof command === 'string') { |
| 138 | const m = /paste A(\d+) all/.exec(command); |
| 139 | if (m) { |
| 140 | row.row = parseInt(m[1] as string, 10); |
| 141 | } |
| 142 | } |
| 143 | this.rows.push(row); |
| 144 | return this; |
| 145 | } |
| 146 | |
| 147 | /** |
| 148 | * Update a row in-place. When `title` is set, dispatches a |