mirror of
https://github.com/infinilabs/coco-app.git
synced 2025-12-16 19:47:43 +01:00
fix: resolved an issue where number keys were not working on the web (#616)
* fix: resolved an issue where number keys were not working on the web * docs: update changelog
This commit is contained in:
@@ -22,6 +22,7 @@ Information about release notes of Coco Server is provided here.
|
|||||||
- fix: new chat assistant id not found #603
|
- fix: new chat assistant id not found #603
|
||||||
- fix: resolve regex error on older macOS versions #605
|
- fix: resolve regex error on older macOS versions #605
|
||||||
- fix: fix chat log update and sorting issues #612
|
- fix: fix chat log update and sorting issues #612
|
||||||
|
- fix: resolved an issue where number keys were not working on the web #616
|
||||||
|
|
||||||
### ✈️ Improvements
|
### ✈️ Improvements
|
||||||
|
|
||||||
|
|||||||
1
scripts/devWeb.ts
Normal file
1
scripts/devWeb.ts
Normal file
@@ -0,0 +1 @@
|
|||||||
|
(() => {})();
|
||||||
@@ -84,6 +84,8 @@ export function useKeyboardNavigation({
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (e.key >= "0" && e.key <= "9" && showIndex && isMetaOrCtrlKey(e)) {
|
if (e.key >= "0" && e.key <= "9" && showIndex && isMetaOrCtrlKey(e)) {
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
let index = parseInt(e.key, 10);
|
let index = parseInt(e.key, 10);
|
||||||
|
|
||||||
index = index === 0 ? 9 : index - 1;
|
index = index === 0 ? 9 : index - 1;
|
||||||
@@ -91,7 +93,13 @@ export function useKeyboardNavigation({
|
|||||||
const item = globalItemIndexMap[index];
|
const item = globalItemIndexMap[index];
|
||||||
|
|
||||||
if (item?.on_opened) {
|
if (item?.on_opened) {
|
||||||
platformAdapter.invokeBackend("open", { onOpened: item.on_opened });
|
return platformAdapter.invokeBackend("open", {
|
||||||
|
onOpened: item.on_opened,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (item?.url) {
|
||||||
|
OpenURLWithBrowser(item.url);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user