Skip to content

Commit dcb373f

Browse files
authoredMar 4, 2024
Merge branch 'master' into all-internal
2 parents 6dbf21d + b792d8e commit dcb373f

File tree

4 files changed

+8
-11
lines changed

4 files changed

+8
-11
lines changed
 

‎app/Http/Controllers/Forum/PostsController.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -143,14 +143,14 @@ public function raw($id)
143143
{
144144
$post = Post::withTrashed()->findOrFail($id);
145145

146-
if ($post->trashed()) {
147-
priv_check('ForumModerate', $post->forum)->ensureCan();
148-
}
149-
150146
if ($post->forum === null || $post->topic === null) {
151147
abort(404);
152148
}
153149

150+
if ($post->trashed() || $post->topic->trashed()) {
151+
priv_check('ForumModerate', $post->forum)->ensureCan();
152+
}
153+
154154
priv_check('ForumView', $post->forum)->ensureCan();
155155

156156
$text = $post->bodyRaw;

‎app/Models/Solo/Score.php

+2-5
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
use App\Libraries\Score\UserRank;
1414
use App\Libraries\Search\ScoreSearchParams;
1515
use App\Models\Beatmap;
16-
use App\Models\Beatmapset;
1716
use App\Models\Model;
1817
use App\Models\Multiplayer\ScoreLink as MultiplayerScoreLink;
1918
use App\Models\Score as LegacyScore;
@@ -120,10 +119,8 @@ public static function extractParams(array $rawParams, ScoreToken|MultiplayerSco
120119
$params['user_id'] = $scoreToken->user_id;
121120

122121
$beatmap = $scoreToken->beatmap;
123-
$params['ranked'] = $beatmap !== null && in_array($beatmap->approved, [
124-
Beatmapset::STATES['approved'],
125-
Beatmapset::STATES['ranked'],
126-
], true);
122+
// anything that have leaderboard
123+
$params['ranked'] = $beatmap !== null && $beatmap->approved > 0;
127124

128125
$params['preserve'] = $params['passed'] ?? false;
129126

‎app/Models/Traits/Scoreable.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ public function recalculateRank(): void
170170
private function shouldHaveHiddenRank(): bool
171171
{
172172
foreach ($this->enabled_mods as $mod) {
173-
if ($mod === 'FL' || $mod === 'HD') {
173+
if ($mod === 'FI' || $mod === 'FL' || $mod === 'HD') {
174174
return true;
175175
}
176176
}

‎resources/js/utils/legacy-score-helper.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ document.addEventListener('turbolinks:load', () => {
1616
});
1717

1818
function shouldHaveHiddenRank(score: SoloScoreJson) {
19-
return score.mods.some((mod) => mod.acronym === 'FL' || mod.acronym === 'HD');
19+
return score.mods.some((mod) => mod.acronym === 'FI' || mod.acronym === 'FL' || mod.acronym === 'HD');
2020
}
2121

2222
export function legacyAccuracyAndRank(score: SoloScoreJson) {

0 commit comments

Comments
 (0)