Update
This commit is contained in:
@@ -2,9 +2,9 @@
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
use App\Jobs\TrackSearchJob;
|
||||
use App\Jobs\TrackContentSelectionJob;
|
||||
use App\Jobs\TrackExportJob;
|
||||
use App\Jobs\TrackSearchJob;
|
||||
use App\Jobs\UpdateExportStatusJob;
|
||||
use Carbon\Carbon;
|
||||
|
||||
@@ -118,7 +118,7 @@ public function updateExportStatus(
|
||||
public function getDeviceContext(): array
|
||||
{
|
||||
$request = request();
|
||||
|
||||
|
||||
return [
|
||||
'user_agent' => $request->userAgent(),
|
||||
'ip_address' => $request->ip(),
|
||||
@@ -132,15 +132,15 @@ public function getDeviceContext(): array
|
||||
public function generateDeviceId(): string
|
||||
{
|
||||
$request = request();
|
||||
|
||||
|
||||
// Generate a consistent device ID based on session or create new one
|
||||
if ($request->session()->has('device_id')) {
|
||||
return $request->session()->get('device_id');
|
||||
}
|
||||
|
||||
|
||||
$deviceId = str()->uuid()->toString();
|
||||
$request->session()->put('device_id', $deviceId);
|
||||
|
||||
|
||||
return $deviceId;
|
||||
}
|
||||
|
||||
@@ -151,7 +151,7 @@ public function quickTrackSearch(string $searchType, string $searchQuery, ?array
|
||||
{
|
||||
$context = $this->getDeviceContext();
|
||||
$deviceId = $this->generateDeviceId();
|
||||
|
||||
|
||||
$this->trackSearch(
|
||||
$deviceId,
|
||||
$searchType,
|
||||
@@ -168,7 +168,7 @@ public function quickTrackContentSelection(string $contentType, int $contentId,
|
||||
{
|
||||
$context = $this->getDeviceContext();
|
||||
$deviceId = $this->generateDeviceId();
|
||||
|
||||
|
||||
$this->trackContentSelection(
|
||||
$deviceId,
|
||||
$contentType,
|
||||
@@ -187,7 +187,7 @@ public function quickTrackExport(?int $memeId, ?int $memeMediaId, ?int $backgrou
|
||||
{
|
||||
$context = $this->getDeviceContext();
|
||||
$deviceId = $this->generateDeviceId();
|
||||
|
||||
|
||||
return $this->trackExport(
|
||||
$deviceId,
|
||||
$memeId,
|
||||
@@ -202,4 +202,4 @@ public function quickTrackExport(?int $memeId, ?int $memeMediaId, ?int $backgrou
|
||||
$context['platform']
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user