Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamKyle committed Jan 5, 2024
1 parent cbcc1d5 commit c7c616a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 3 additions & 2 deletions app/Game/Factions/FactionLoyalty/Concerns/FactionLoyalty.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ public function getNpcCurrentlyHelping(FactionLoyaltyModel $factionLoyalty): ?Fa
* @return bool
*/
public function hasMatchingTask(FactionLoyaltyNpc $helpingNpc, string $key, int $id): bool {

return collect($helpingNpc->factionLoyaltyNpcTasks->fame_tasks)->filter(function($task) use ($key, $id) {
return isset($task[$key]) && $task[$key] === $id;
})->isNotEmpty();
Expand All @@ -54,7 +53,9 @@ public function hasMatchingTask(FactionLoyaltyNpc $helpingNpc, string $key, int
*/
public function updateMatchingHelpTask(FactionLoyaltyNpc $helpingNpc, string $key, int $id): FactionLoyaltyNpc {
$tasks = array_map(function ($task) use ($key, $id) {
return array_key_exists($key, $task) ? array_merge($task, ['current_amount' => min($task['current_amount'] + 1, $task['required_amount'])]) : $task;
return isset($task[$key]) && ($task[$key] === $id) ?
array_merge($task, ['current_amount' => min($task['current_amount'] + 1, $task['required_amount'])]) :
$task;
}, $helpingNpc->factionLoyaltyNpcTasks->fame_tasks);

$helpingNpc->factionLoyaltyNpcTasks()->update([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,11 @@ export default class FightSection extends React.Component<

render() {
if (this.state.setting_up_regular_fight) {
return <LoadingProgressBar />;
return (
<div className="flex items-center justify-center">
<LoadingProgressBar />
</div>
)
}

if (this.state.error_message !== "") {
Expand Down

0 comments on commit c7c616a

Please sign in to comment.