Skip to content

Commit 3f320af

Browse files
committed
The first of 3 edits to unify platform detection
1 parent ab4a801 commit 3f320af

1 file changed

Lines changed: 2 additions & 14 deletions

File tree

server.py

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2943,23 +2943,11 @@ async def poke_flyout(request):
29432943
Br(),
29442944
Span('🖥️ Platform: ', Span('Detecting...', id='platform-info'), cls='version-info-text'),
29452945
Script('''
2946-
// Platform detection for Mac keyboard shortcuts
29472946
(function() {
2948-
const platform = navigator.platform.toLowerCase();
2949-
const userAgent = navigator.userAgent.toLowerCase();
2950-
let platformName = 'Unknown';
2951-
2952-
if (platform.includes('mac') || userAgent.includes('mac')) {
2953-
platformName = 'Mac';
2954-
} else if (platform.includes('win') || userAgent.includes('windows')) {
2955-
platformName = 'Windows';
2956-
} else if (platform.includes('linux') || userAgent.includes('linux')) {
2957-
platformName = 'Linux';
2958-
}
29592947
29602948
const platformElement = document.getElementById('platform-info');
2961-
if (platformElement) {
2962-
platformElement.textContent = platformName;
2949+
if (platformElement && window.CURRENT_PLATFORM_NAME) {
2950+
platformElement.textContent = window.CURRENT_PLATFORM_NAME;
29632951
}
29642952
})();
29652953
'''),

0 commit comments

Comments
 (0)