|
|
@ -96,17 +96,15 @@ export class GraphApp extends App { |
|
|
|
switch (msg.method) { |
|
|
|
case DidChangeNotificationType.method: |
|
|
|
onIpc(DidChangeNotificationType, msg, params => { |
|
|
|
const previousRowCount = this.state.rows?.length; |
|
|
|
this.setState({ ...this.state, ...params.state }); |
|
|
|
this.refresh(this.state, previousRowCount); |
|
|
|
this.refresh(this.state); |
|
|
|
}); |
|
|
|
break; |
|
|
|
|
|
|
|
case DidChangeAvatarsNotificationType.method: |
|
|
|
onIpc(DidChangeAvatarsNotificationType, msg, params => { |
|
|
|
const previousRowCount = this.state.rows?.length; |
|
|
|
this.setState({ ...this.state, avatars: params.avatars }); |
|
|
|
this.refresh(this.state, previousRowCount); |
|
|
|
this.refresh(this.state); |
|
|
|
}); |
|
|
|
break; |
|
|
|
|
|
|
@ -173,42 +171,39 @@ export class GraphApp extends App { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const previousRowCount = this.state.rows?.length; |
|
|
|
this.setState({ |
|
|
|
...this.state, |
|
|
|
avatars: params.avatars, |
|
|
|
rows: rows, |
|
|
|
loading: false, |
|
|
|
paging: params.paging, |
|
|
|
}); |
|
|
|
this.refresh(this.state, previousRowCount); |
|
|
|
this.refresh(this.state); |
|
|
|
}); |
|
|
|
break; |
|
|
|
|
|
|
|
case DidChangeSelectionNotificationType.method: |
|
|
|
onIpc(DidChangeSelectionNotificationType, msg, params => { |
|
|
|
const previousRowCount = this.state.rows?.length; |
|
|
|
this.setState({ ...this.state, selectedRows: params.selection }); |
|
|
|
this.refresh(this.state, previousRowCount); |
|
|
|
this.refresh(this.state); |
|
|
|
}); |
|
|
|
break; |
|
|
|
|
|
|
|
case DidChangeGraphConfigurationNotificationType.method: |
|
|
|
onIpc(DidChangeGraphConfigurationNotificationType, msg, params => { |
|
|
|
const previousRowCount = this.state.rows?.length; |
|
|
|
this.setState({ ...this.state, config: params.config }); |
|
|
|
this.refresh(this.state, previousRowCount); |
|
|
|
this.refresh(this.state); |
|
|
|
}); |
|
|
|
break; |
|
|
|
|
|
|
|
case DidChangeSubscriptionNotificationType.method: |
|
|
|
onIpc(DidChangeSubscriptionNotificationType, msg, params => { |
|
|
|
const previousRowCount = this.state.rows?.length; |
|
|
|
this.setState({ |
|
|
|
...this.state, |
|
|
|
subscription: params.subscription, |
|
|
|
allowed: params.allowed, |
|
|
|
}); |
|
|
|
this.refresh(this.state, previousRowCount); |
|
|
|
this.refresh(this.state); |
|
|
|
}); |
|
|
|
break; |
|
|
|
|
|
|
@ -218,9 +213,8 @@ export class GraphApp extends App { |
|
|
|
} |
|
|
|
|
|
|
|
protected override onThemeUpdated() { |
|
|
|
const previousRowCount = this.state.rows?.length; |
|
|
|
this.setState({ ...this.state, mixedColumnColors: undefined }); |
|
|
|
this.refresh(this.state, previousRowCount); |
|
|
|
this.refresh(this.state); |
|
|
|
} |
|
|
|
|
|
|
|
protected override setState(state: State) { |
|
|
@ -297,8 +291,8 @@ export class GraphApp extends App { |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
private refresh(state: State, previousRowCount: number | undefined) { |
|
|
|
this.callback?.(state, previousRowCount); |
|
|
|
private refresh(state: State) { |
|
|
|
this.callback?.(state); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|