state.matches)),
@@ -43,6 +47,8 @@ export class App implements OnInit {
if (this.auth.isAuthenticated()) {
this.auth.loadCurrentUser().subscribe({ error: () => undefined });
}
+
+ void this.offlineSync.syncNow();
}
protected toggleSidebar(): void {
diff --git a/listify-client/src/app/assistant/assistant-chat.component.html b/listify-client/src/app/assistant/assistant-chat.component.html
index 4384e8e..6e4d034 100644
--- a/listify-client/src/app/assistant/assistant-chat.component.html
+++ b/listify-client/src/app/assistant/assistant-chat.component.html
@@ -2,9 +2,9 @@
@@ -50,6 +50,7 @@
matInput
rows="3"
[value]="draft()"
+ [disabled]="!onlineStatus.online()"
(input)="draft.set($any($event.target).value)"
(keydown.enter)="handleEnter($event)"
>
diff --git a/listify-client/src/app/assistant/assistant-chat.component.ts b/listify-client/src/app/assistant/assistant-chat.component.ts
index 2e293ca..433dc9b 100644
--- a/listify-client/src/app/assistant/assistant-chat.component.ts
+++ b/listify-client/src/app/assistant/assistant-chat.component.ts
@@ -15,6 +15,7 @@ import {
} from './assistant.models';
import { AssistantService } from './assistant.service';
import { ListsService } from '../lists/lists.service';
+import { OnlineStatusService } from '../offline/online-status.service';
import { TemplatesService } from '../templates/templates.service';
@Component({
@@ -33,6 +34,7 @@ import { TemplatesService } from '../templates/templates.service';
export class AssistantChatComponent {
private readonly assistantService = inject(AssistantService);
private readonly listsService = inject(ListsService);
+ protected readonly onlineStatus = inject(OnlineStatusService);
private readonly router = inject(Router);
private readonly templatesService = inject(TemplatesService);
@@ -46,13 +48,20 @@ export class AssistantChatComponent {
protected readonly sending = signal(false);
protected readonly errorMessage = signal(null);
protected readonly canSend = computed(
- () => this.draft().trim().length > 0 && !this.sending(),
+ () =>
+ this.draft().trim().length > 0 &&
+ !this.sending() &&
+ this.onlineStatus.online(),
);
protected send(): void {
const content = this.draft().trim();
- if (!content || this.sending()) {
+ if (!content || this.sending() || !this.onlineStatus.online()) {
+ if (!this.onlineStatus.online()) {
+ this.errorMessage.set('Der Assistent ist nur online verfuegbar.');
+ }
+
return;
}
diff --git a/listify-client/src/app/lists/list-detail/list-detail.component.html b/listify-client/src/app/lists/list-detail/list-detail.component.html
index 2041350..3a89c84 100644
--- a/listify-client/src/app/lists/list-detail/list-detail.component.html
+++ b/listify-client/src/app/lists/list-detail/list-detail.component.html
@@ -259,7 +259,7 @@