Only show toast when the layout has been changed

This commit is contained in:
redphx 2024-02-07 14:56:36 +07:00
parent a878150ec3
commit 6b090194c9

View File

@ -3553,6 +3553,8 @@ class TouchController {
return;
}
const layoutChanged = TouchController.#currentLayoutId !== layoutId;
TouchController.#currentLayoutId = layoutId;
xboxTitleId = '' + xboxTitleId;
@ -3566,7 +3568,7 @@ class TouchController {
const layout = (layoutData.layouts[layoutId] || layoutData.layouts[layoutData.default_layout]);
if (layout) {
// Show a toast with layout's name
Toast.show(__('touch-control-layout'), layout.name);
layoutChanged && Toast.show(__('touch-control-layout'), layout.name);
setTimeout(() => {
window.BX_EXPOSED.touch_layout_manager.changeLayoutForScope({