Editor: live settings sync + session-death banner
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -89,6 +89,16 @@
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (sessionDead()) {
|
||||
<div
|
||||
class="flex shrink-0 items-center gap-2 border-b border-border bg-destructive/10 px-3 py-1.5 text-[11px] text-destructive"
|
||||
>
|
||||
<ng-icon name="mynaXCircle" size="0.85rem" class="shrink-0" />
|
||||
Disconnected from {{ ctx.sessionTitle }} — saving will fail, but your text is preserved
|
||||
in this window.
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (loading()) {
|
||||
<div class="flex flex-1 items-center justify-center">
|
||||
<ng-icon name="mynaSpinner" size="1.25rem" class="animate-spin text-primary" />
|
||||
|
||||
@@ -32,23 +32,28 @@ export class SettingsService {
|
||||
this.applyAccent();
|
||||
if (!this.rpc.available) return;
|
||||
void this.rpc.request.getSettings({}).then((res) => {
|
||||
if (!res.ok) return;
|
||||
this.theme.set(res.settings.theme);
|
||||
this.darkTone.set(res.settings.darkTone);
|
||||
this.accent.set(res.settings.accent);
|
||||
this.iconColors.set(res.settings.iconColors);
|
||||
this.speedUnit.set(res.settings.speedUnit);
|
||||
this.textSize.set(res.settings.textSize);
|
||||
this.transferMode.set(res.settings.transferMode);
|
||||
this.transferConcurrency.set(res.settings.transferConcurrency);
|
||||
this.autoClearCompleted.set(res.settings.autoClearCompleted);
|
||||
this.editor.set(res.settings.editor);
|
||||
this.editorApp.set(res.settings.editorApp);
|
||||
this.applyTheme();
|
||||
this.applyDarkTone();
|
||||
this.applyAccent();
|
||||
this.applyTextSize();
|
||||
if (res.ok) this.applyAll(res.settings);
|
||||
});
|
||||
// editor windows: follow settings the main window saves, live
|
||||
this.rpc.onSettingsChanged((settings) => this.applyAll(settings));
|
||||
}
|
||||
|
||||
private applyAll(settings: AppSettings): void {
|
||||
this.theme.set(settings.theme);
|
||||
this.darkTone.set(settings.darkTone);
|
||||
this.accent.set(settings.accent);
|
||||
this.iconColors.set(settings.iconColors);
|
||||
this.speedUnit.set(settings.speedUnit);
|
||||
this.textSize.set(settings.textSize);
|
||||
this.transferMode.set(settings.transferMode);
|
||||
this.transferConcurrency.set(settings.transferConcurrency);
|
||||
this.autoClearCompleted.set(settings.autoClearCompleted);
|
||||
this.editor.set(settings.editor);
|
||||
this.editorApp.set(settings.editorApp);
|
||||
this.applyTheme();
|
||||
this.applyDarkTone();
|
||||
this.applyAccent();
|
||||
this.applyTextSize();
|
||||
}
|
||||
|
||||
setTheme(theme: AppSettings['theme']): void {
|
||||
|
||||
Reference in New Issue
Block a user