Skip to content

Commit

Permalink
fix: make defaultSource to support asset:/
Browse files Browse the repository at this point in the history
  • Loading branch information
ashercai committed May 21, 2024
1 parent 19496e6 commit f4599ce
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ export default abstract class HippyRenderBaseView {
return true
}

private convertToLocalPathIfNeeded(uri: string): ResourceStr {
protected convertToLocalPathIfNeeded(uri: string): ResourceStr {
// hpfile://./assets/defaultSource.jpg
if (uri != null) {
if (uri.startsWith("hpfile://")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,12 +297,8 @@ export class HRImageView extends HippyRenderBaseView {
return true
case 'defaultSource':
{
this.cssAlt = HRValueUtils.getString(propValue as HippyAny)
if (this.cssAlt?.startsWith(HRImageView.RAW_IMAGE_PREFIX)) {
this.cssAlt = this.convertToLocalPath(this.cssAlt)
this.cssAlt = $rawfile(this.cssAlt)
return true
}
let cssAlt = HRValueUtils.getString(propValue as HippyAny)
this.cssAlt = this.convertToLocalPathIfNeeded(cssAlt)
}
return true
case 'tintColor'://ARGB
Expand Down

0 comments on commit f4599ce

Please sign in to comment.