Skip to content

Commit a632b6e

Browse files
authored
fix: 解决RNOH框架升级,descriptor取值异常导致crash。 (#16)
1 parent ff32e5a commit a632b6e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

harmony/rnoh_signature_capture/src/main/ets/SignatureCaptureArk.ets

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,12 @@ export struct SignatureCaptureArkView {
6262

6363
this.eventEmitter = new RNC.RSSignatureArkView.EventEmitter(this.ctx.rnInstance, this.tag)
6464

65-
this.onDescriptorWrapperChange(this.ctx.descriptorRegistry.findDescriptorWrapperByTag<RNC.RSSignatureArkView.DescriptorWrapper>(this.tag)!)
65+
this.onDescriptorWrapperChange(this.ctx.descriptorRegistry.getDescriptor<RNC.RSSignatureArkView.Descriptor>(this.tag)!)
6666

6767
this.cleanUpCallbacks.push(this.ctx.descriptorRegistry.subscribeToDescriptorChanges(this.tag,
68-
(_descriptor, newDescriptorWrapper) => {
68+
descriptor => {
6969
this.logger.info('signature capture descriptor change!');
70-
this.onDescriptorWrapperChange(newDescriptorWrapper! as RNC.RSSignatureArkView.DescriptorWrapper)
70+
this.onDescriptorWrapperChange(descriptor! as RNC.RSSignatureArkView.Descriptor)
7171
}
7272
));
7373

@@ -127,9 +127,9 @@ export struct SignatureCaptureArkView {
127127
this.sign.color = this.descriptorWrapper.props.strokeColor.toRGBAString();
128128
}
129129

130-
private onDescriptorWrapperChange(descriptorWrapper: RNC.RSSignatureArkView.DescriptorWrapper) {
130+
private onDescriptorWrapperChange(descriptor: RNC.RSSignatureArkView.Descriptor) {
131131
this.logger.info('descriptor change!');
132-
this.descriptorWrapper = descriptorWrapper;
132+
this.descriptorWrapper = new RNC.RSSignatureArkView.DescriptorWrapper(descriptor);
133133
this.setProps();
134134
}
135135

0 commit comments

Comments
 (0)