Skip to content

Commit

Permalink
fix(view): fix timestamp print invalid file url
Browse files Browse the repository at this point in the history
  • Loading branch information
aidenlx committed Mar 17, 2024
1 parent 8b3209c commit 9631f67
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions apps/app/src/web/url-match/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,15 @@ export class MediaURL extends URL implements URLResolveResult {
return !!other && this.jsonState.source === other.jsonState.source;
}

/**
* Print the url with temporal fragment encoded (if supported)
* @returns the url without hash
*/
print(frag?: TempFragment): string {
if (this.mxUrl) return this.mxUrl.href;
if (!frag) return this.source.href;
if (this.mxUrl) return noHash(this.mxUrl.href);
if (!frag) return this.jsonState.source;
if (this.#resolved.print) return this.#resolved.print(frag);
return this.source.href;
return this.jsonState.source;
}

get tempFrag(): TempFragment | null {
Expand Down

0 comments on commit 9631f67

Please sign in to comment.