Minor fix in showGamepadToast()

This commit is contained in:
redphx 2024-04-12 20:37:45 +07:00
parent b27f84b980
commit ec6c3fc8a3

View File

@ -12099,6 +12099,11 @@ MkbHandler.setupEvents();
// Show a toast when connecting/disconecting controller
function showGamepadToast(gamepad) {
// Don't show Toast for virtual controller
if (gamepad.id === MkbHandler.VIRTUAL_GAMEPAD_ID) {
return;
}
console.log(gamepad);
let text = '🎮';
@ -12108,12 +12113,6 @@ function showGamepadToast(gamepad) {
// Remove "(STANDARD GAMEPAD Vendor: xxx Product: xxx)" from ID
const gamepadId = gamepad.id.replace(/ \(.*?Vendor: \w+ Product: \w+\)$/, '');
// Don't show Toast for virtual controller
if (gamepadId === MkbHandler.VIRTUAL_GAMEPAD_ID) {
return;
}
text += ` - ${gamepadId}`;
let status;