Skip to content

Commit

Permalink
Fixed a few bugs with state-resetting, a forced page rebuild works well.
Browse files Browse the repository at this point in the history
Signed-off-by: Dave Shanley <[email protected]>
  • Loading branch information
daveshanley committed Aug 1, 2023
1 parent d1077de commit 6990afb
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion ui/src/components/controls/controls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export class WiretapControlsComponent extends LitElement {

controlUpdateHandler(): BusCallback<CommandResponse> {
return (msg: Message<CommandResponse<ControlsResponse>>) => {
const delay = msg.payload.payload.config.globalAPIDelay;
const delay = msg.payload.payload?.config.globalAPIDelay;
const existingDelay = this._controls?.globalDelay;

if (delay == undefined) {
Expand Down
2 changes: 1 addition & 1 deletion ui/src/components/kv-view/kv-view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class KVViewComponent extends LitElement {
}

set data(value: Map<string, any>) {
if (value.size > 0) {
if (value && value.size > 0) {
this._data = value;
}
}
Expand Down
6 changes: 3 additions & 3 deletions ui/src/components/transaction/transaction-container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ export class HttpTransactionContainerComponent extends LitElement {
let filtered: HttpTransactionItemComponent[] = this._transactionComponents;

// filter by method
if (this._filters.filterMethod.keyword.length > 0) {
if (this._filters?.filterMethod.keyword.length > 0) {
filtered = this._transactionComponents.filter(
(v: HttpTransactionItemComponent) => {
const filter = v.httpTransaction.matchesMethodFilter(this._filters);
Expand All @@ -218,15 +218,15 @@ export class HttpTransactionContainerComponent extends LitElement {
}

// re-filter by keywords
if (this._filters.filterKeywords.length > 0) {
if (this._filters?.filterKeywords.length > 0) {
filtered = filtered.filter((v: HttpTransactionItemComponent) => {
const filter = v.httpTransaction.matchesKeywordFilter(this._filters);
return filter != false;
})
}

// re-filter by chains
if (this._filters.filterChain.length > 0) {
if (this._filters?.filterChain.length > 0) {
filtered = filtered.filter((v: HttpTransactionItemComponent) => {
const filter = v.httpTransaction.containsActiveLink(this._filters);
v.httpTransaction.containsChainLink = (filter != false);
Expand Down
1 change: 1 addition & 0 deletions ui/src/wiretap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ export class WiretapComponent extends LitElement {
this.violationsCount = 0;
this.calcComplianceLevel();
localforage.clear()
window.location.reload()
}

render() {
Expand Down

0 comments on commit 6990afb

Please sign in to comment.