Skip to content

Commit a36bb83

Browse files
committed
feat(cc-logs-addon-runtime): handle cc-logs-clear event to clear displayed logs
1 parent 24da361 commit a36bb83

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/components/cc-logs-addon-runtime/cc-logs-addon-runtime.smart.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ defineSmartComponent({
4747
controller.setNewDateRange(range);
4848
});
4949

50+
onEvent('cc-logs-clear', () => {
51+
controller.clearVisibleLogs();
52+
});
53+
5054
onEvent('cc-logs-loading-pause', () => {
5155
controller.pause();
5256
});
@@ -159,6 +163,11 @@ class SmartController extends LogsStream {
159163
this._component.appendLogs(logs);
160164
}
161165

166+
clearVisibleLogs() {
167+
this.resetVisible();
168+
this._component.clear();
169+
}
170+
162171
init() {
163172
this.openLogsStream(this._dateRange);
164173
}

0 commit comments

Comments
 (0)