git-watchtower 1.9.15 → 1.9.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/state/store.js +4 -4
package/package.json
CHANGED
package/src/state/store.js
CHANGED
|
@@ -355,7 +355,7 @@ class Store {
|
|
|
355
355
|
*/
|
|
356
356
|
addLog(message, type = 'info', maxEntries = 10) {
|
|
357
357
|
const entry = { message, type, timestamp: new Date() };
|
|
358
|
-
const activityLog = [...this.state.activityLog
|
|
358
|
+
const activityLog = [entry, ...this.state.activityLog].slice(0, maxEntries);
|
|
359
359
|
this.setState({ activityLog });
|
|
360
360
|
}
|
|
361
361
|
|
|
@@ -367,7 +367,7 @@ class Store {
|
|
|
367
367
|
*/
|
|
368
368
|
addToHistory(from, to, maxEntries = 20) {
|
|
369
369
|
const entry = { from, to, timestamp: new Date() };
|
|
370
|
-
const switchHistory = [...this.state.switchHistory
|
|
370
|
+
const switchHistory = [entry, ...this.state.switchHistory].slice(0, maxEntries);
|
|
371
371
|
this.setState({ switchHistory });
|
|
372
372
|
}
|
|
373
373
|
|
|
@@ -377,14 +377,14 @@ class Store {
|
|
|
377
377
|
*/
|
|
378
378
|
getLastSwitch() {
|
|
379
379
|
const history = this.state.switchHistory;
|
|
380
|
-
return history.length > 0 ? history[
|
|
380
|
+
return history.length > 0 ? history[0] : null;
|
|
381
381
|
}
|
|
382
382
|
|
|
383
383
|
/**
|
|
384
384
|
* Remove the last switch from history (after undo)
|
|
385
385
|
*/
|
|
386
386
|
popHistory() {
|
|
387
|
-
const switchHistory = this.state.switchHistory.slice(
|
|
387
|
+
const switchHistory = this.state.switchHistory.slice(1);
|
|
388
388
|
this.setState({ switchHistory });
|
|
389
389
|
}
|
|
390
390
|
|