#128 - add position check

This commit is contained in:
isUnknown 2025-02-19 09:38:01 +01:00
parent 092f3f0f7c
commit 37a978763c
3 changed files with 43 additions and 16 deletions

View file

@ -20,7 +20,13 @@ return [
$comments = $file->comments()->isEmpty() == true ? [] : Yaml::decode($file->comments()->value());
foreach ($comments as $existingComment) {
if ($existingComment['author']['email'] === $user->email() && $existingComment['text'] === $data->text) {
if
(
$existingComment['author']['email'] == $user->email() &&
$existingComment['text'] == $data->text &&
$existingComment['position']['x'] == $data->position->x &&
$existingComment['position']['y'] == $data->position->y
) {
return json_encode(null);
}
}

View file

@ -11,6 +11,7 @@ $project = [
'steps' => $page->getSteps(),
'designToLight' => $page->isDTLEnabled()->isTrue() ? processDTLProposals($page) : null,
'hasOptimizationRequest' => $page->hasOptimizationRequest()->isTrue(),
'notifications' => $page->notifications()->yaml(),
];
$pageData = array_merge($genericData, $project);