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:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user