Disable Open in osu!web option on user page when replay_id is 0
Usually, when the `replay_id` is 0 it means the replay was set offline or not uploaded to osu-web for some reason. Disable the link when this is the case, as it will just take them to a Not Found page.
This commit is contained in:
parent
735f3427c5
commit
eb0c62756b
@ -45,7 +45,7 @@
|
|||||||
|
|
||||||
<div style="display: flex; justify-content: space-between; margin-bottom: 10px" class="link-list">
|
<div style="display: flex; justify-content: space-between; margin-bottom: 10px" class="link-list">
|
||||||
|
|
||||||
<a style="flex: 1" class="text-center" href="https://osu.ppy.sh/scores/osu/{{ this.replayData.replay_id }}" target="_blank">
|
<a style="flex: 1" class="text-center" href="https://osu.ppy.sh/scores/osu/{{ this.replayData.replay_id }}" target="_blank" [class.disabled]="!isWebScore()">
|
||||||
Open in osu!web
|
Open in osu!web
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
|||||||
@ -63,6 +63,10 @@ export class ViewScoreComponent implements OnInit {
|
|||||||
return this.hasErrorDistribution();
|
return this.hasErrorDistribution();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isWebScore(): boolean {
|
||||||
|
return !!this.replayData && this.replayData.replay_id !== 0;
|
||||||
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.activatedRoute.params.subscribe(params => {
|
this.activatedRoute.params.subscribe(params => {
|
||||||
this.replayId = params['replayId'];
|
this.replayId = params['replayId'];
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user