FIX: set reminder options on menu render (#35694)

Without this when we set bookmark reminders the time is based on when
the element was first added to the page which may be much prior
This commit is contained in:
Sam
2025-10-30 12:40:47 +11:00
committed by GitHub
parent d4ac43e605
commit 5a8d31385c
@@ -2,7 +2,6 @@ import Component from "@glimmer/component";
import { tracked } from "@glimmer/tracking";
import { fn } from "@ember/helper";
import { action } from "@ember/object";
import didInsert from "@ember/render-modifiers/modifiers/did-insert";
import { service } from "@ember/service";
import DButton from "discourse/components/d-button";
import DropdownMenu from "discourse/components/dropdown-menu";
@@ -22,6 +21,7 @@ export default class BookmarkMenu extends Component {
@service toasts;
@tracked quicksaved = false;
@tracked reminderAtOptions = [];
bookmarkManager = this.args.bookmarkManager;
timezone = this.currentUser?.user_option?.timezone || moment.tz.guess();
@@ -143,6 +143,7 @@ export default class BookmarkMenu extends Component {
@action
onShowMenu() {
this.setReminderShortcuts();
if (!this.existingBookmark) {
this.onBookmark();
}
@@ -253,7 +254,6 @@ export default class BookmarkMenu extends Component {
<template>
<DMenu
{{didInsert this.setReminderShortcuts}}
...attributes
@identifier="bookmark-menu"
class={{this.buttonClasses}}