Skip to content

Commit 5fbe3a5

Browse files
authored
Merge pull request #50 from me-shaon/fix/gh-46-windows-logo-not-showing
Normalize OS name to handel windows variants
2 parents c1bbf9d + d7e6442 commit 5fbe3a5

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

resources/views/components/analytics/operating-systems.blade.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,14 @@
55
@php
66
if (!function_exists('getOperatingSystemImage')) {
77
function getOperatingSystemImage($os): string {
8-
$os = str_replace(' ', '', strtolower($os));
9-
return match($os){
10-
'windows' => asset('vendor/request-analytics/operating-systems/windows-logo.png'),
8+
$normalizedOs = str_replace(' ', '', strtolower($os));
9+
10+
// Handle Windows variants (Windows 10, Windows 7, etc.)
11+
if (str_starts_with($normalizedOs, 'windows')) {
12+
return asset('vendor/request-analytics/operating-systems/windows-logo.png');
13+
}
14+
15+
return match($normalizedOs){
1116
'linux' => asset('vendor/request-analytics/operating-systems/linux.png'),
1217
'macos', 'macosx' => asset('vendor/request-analytics/operating-systems/mac-logo.png'),
1318
'android' => asset('vendor/request-analytics/operating-systems/android-os.png'),

0 commit comments

Comments
 (0)