Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ export class UmbLogViewerWorkspaceContext extends UmbContextBase implements UmbW
override hostDisconnected(): void {
super.hostDisconnected();
window.removeEventListener('changestate', this.onChangeState);
this.stopPolling();
}

onChangeState = () => {
Expand Down Expand Up @@ -320,7 +321,7 @@ export class UmbLogViewerWorkspaceContext extends UmbContextBase implements UmbW
return;
}

clearInterval(this.#intervalID as number);
this.stopPolling();
}

setPollingInterval(interval: UmbPoolingInterval) {
Expand All @@ -332,6 +333,13 @@ export class UmbLogViewerWorkspaceContext extends UmbContextBase implements UmbW
const newDirection = direction === DirectionModel.ASCENDING ? DirectionModel.DESCENDING : DirectionModel.ASCENDING;
this.#sortingDirection.setValue(newDirection);
}

stopPolling() {
if (this.#intervalID) {
clearInterval(this.#intervalID);
this.#intervalID = null;
}
}
}

export { UmbLogViewerWorkspaceContext as api };
Loading