Skip to content

Commit 03706dc

Browse files
committed
MOBILE-4842 reminders: Hide button without component
1 parent 0850136 commit 03706dc

File tree

1 file changed

+10
-6
lines changed
  • src/core/features/reminders/components/date

1 file changed

+10
-6
lines changed

src/core/features/reminders/components/date/date.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,14 @@ export class CoreRemindersDateComponent {
4343
readonly url = input('');
4444

4545
readonly showReminderButton = computed(() => {
46+
// If not set, button won't be shown.
47+
const component = this.component();
48+
const instanceId = this.instanceId();
49+
const type = this.type();
50+
if (component === undefined || instanceId === undefined || type === undefined) {
51+
return false;
52+
}
53+
4654
const remindersEnabled = CoreReminders.isEnabled();
4755

4856
return remindersEnabled && this.time() > CoreTime.timestamp();
@@ -53,15 +61,11 @@ export class CoreRemindersDateComponent {
5361

5462
constructor() {
5563
effect(async () => {
56-
if (!this.showReminderButton()) {
57-
return;
58-
}
59-
60-
// If not set, button won't be shown.
6164
const component = this.component();
6265
const instanceId = this.instanceId();
6366
const type = this.type();
64-
if (component === undefined || instanceId === undefined || type === undefined) {
67+
68+
if (!this.showReminderButton() || component === undefined || instanceId === undefined || type === undefined) {
6569
return;
6670
}
6771

0 commit comments

Comments
 (0)