Skip to content

Commit

Permalink
Fixing click on qrCode button: #353
Browse files Browse the repository at this point in the history
  • Loading branch information
GermanBluefox committed Jan 25, 2025
1 parent 692c855 commit 07a23b1
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
6 changes: 4 additions & 2 deletions src-admin/src/Tabs/Bridges.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1379,7 +1379,8 @@ export class Bridges extends BridgesAndDevices<BridgesProps, BridgesState> {
<IconButton
size="small"
sx={styles.bridgeButtonsAndTitleColor}
onClick={() => {
onClick={e => {
e.stopPropagation();
const bridgesOpened = clone(this.state.bridgesOpened);
bridgesOpened[bridgeIndex] = !bridgesOpened[bridgeIndex];
window.localStorage.setItem(
Expand All @@ -1395,7 +1396,8 @@ export class Bridges extends BridgesAndDevices<BridgesProps, BridgesState> {
<TableCell
style={styles.bridgeHeader}
sx={styles.bridgeButtonsAndTitle}
onClick={() => {
onClick={e => {
e.stopPropagation();
const bridgesOpened = clone(this.state.bridgesOpened);
bridgesOpened[bridgeIndex] = !bridgesOpened[bridgeIndex];
window.localStorage.setItem(
Expand Down
8 changes: 6 additions & 2 deletions src-admin/src/Tabs/BridgesAndDevices.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,8 @@ class BridgesAndDevices<TProps extends BridgesAndDevicesProps, TState extends Br
>
<IconButton
style={{ height: 40, color: this.isDevice ? undefined : '#FFFFFF' }}
onClick={() => {
onClick={e => {
e.stopPropagation();
this.reAnnounceDevice(deviceOrBridge.uuid).catch(e => window.alert(`Cannot re-announce: ${e}`));
this.setState({ showQrCode: deviceOrBridge });
}}
Expand Down Expand Up @@ -372,7 +373,10 @@ class BridgesAndDevices<TProps extends BridgesAndDevicesProps, TState extends Br
: '#00000080'
: '#FFFFFF',
}}
onClick={e => this.requestAdditionalInformation(e, deviceOrBridge.uuid)}
onClick={e => {
e.stopPropagation();
this.requestAdditionalInformation(e, deviceOrBridge.uuid);
}}
>
{hasError ? <Warning /> : <Info />}
</IconButton>
Expand Down
12 changes: 8 additions & 4 deletions src/matter/behaviors/IdentifyServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,14 @@ export class IoIdentifyServer extends IdentifyServer {
if (startToIdentify) {
// push info to UI and show popup, ideally get the name from the device
// or when using uuid be aware it could also be a bridged uuid
void this.internal.adapter.sendToGui({
command: 'identifyPopup',
identifyUuid: this.internal.device.uuid,
});
this.internal.adapter
.sendToGui({
command: 'identifyPopup',
identifyUuid: this.internal.device.uuid,
})
.catch(e => {
this.internal.adapter.log.info(`Error sending identifyPopup: ${e.message}`);
});
this.internal.adapter.log.info(`Identify started for ${this.internal.device.uuid}`);
} else {
this.internal.adapter.log.info(`Identify continues for ${this.internal.device.uuid}`);
Expand Down

0 comments on commit 07a23b1

Please sign in to comment.