fix: start system default sync channels by default

Create and restart paths enable IsSystemDefault channels; SyncPage auto-starts after save.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
whm
2026-08-05 17:50:27 +08:00
parent 42226679c9
commit cb76824e94
6 changed files with 40 additions and 8 deletions

View File

@@ -348,10 +348,21 @@ export function SyncPage(props: {
setBusy(true);
try {
const body = toChannelBody(v, editing?.id);
if (editing) await updateSyncChannel(session, editing.id, body);
else await createSyncChannel(session, body);
const saved = editing
? await updateSyncChannel(session, editing.id, body)
: await createSyncChannel(session, body);
const id = (saved as SyncChannel)?.id || editing?.id;
if (id) {
try {
await startSyncChannel(session, id);
setInfo("同步通道已保存并启动");
} catch {
setInfo("同步通道已保存(启动失败时可手动点「启动」)");
}
} else {
setInfo("同步通道已保存");
}
setOpen(false);
setInfo("同步通道已保存");
await refresh();
} catch (e: any) {
message.error(e.message || String(e));