web: Use util.the for accessing element of single-item lists.

This commit is contained in:
evykassirer
2024-08-19 22:18:02 -07:00
committed by Tim Abbott
parent 113de14547
commit d9f25d01a1
47 changed files with 188 additions and 140 deletions

View File

@@ -363,11 +363,13 @@ export function restore_message(draft: LocalStorageDraft): ComposeArguments {
function draft_notify(): void {
// Display a tooltip to notify the user about the saved draft.
const instance = tippy.default(".top_left_drafts .unread_count", {
content: $t({defaultMessage: "Saved as draft"}),
arrow: true,
placement: "right",
})[0]!;
const instance = util.the(
tippy.default(".top_left_drafts .unread_count", {
content: $t({defaultMessage: "Saved as draft"}),
arrow: true,
placement: "right",
}),
);
instance.show();
function remove_instance(): void {
instance.destroy();