feat: import profiles with enter

This commit is contained in:
Slinetrac
2025-10-14 15:54:26 +08:00
parent 2ba2f4d42c
commit 98527d5038
2 changed files with 11 additions and 0 deletions

View File

@@ -29,6 +29,7 @@
- 修改内核默认日志级别为 Info - 修改内核默认日志级别为 Info
- 支持通过桌面快捷方式重新打开应用 - 支持通过桌面快捷方式重新打开应用
- 主界面“当前节点”卡片每 5 分钟自动测试延迟 - 主界面“当前节点”卡片每 5 分钟自动测试延迟
- 支持订阅界面输入链接后回车导入
### 🐞 修复问题 ### 🐞 修复问题

View File

@@ -1068,6 +1068,16 @@ const ProfilePage = () => {
value={url} value={url}
variant="outlined" variant="outlined"
onChange={(e) => setUrl(e.target.value)} onChange={(e) => setUrl(e.target.value)}
onKeyDown={(event) => {
if (event.key !== "Enter" || event.nativeEvent.isComposing) {
return;
}
if (!url || disabled || loading) {
return;
}
event.preventDefault();
void onImport();
}}
placeholder={t("Profile URL")} placeholder={t("Profile URL")}
slotProps={{ slotProps={{
input: { input: {