diff --git a/apps/client/src/widgets/floating_buttons/geo_map_button.ts b/apps/client/src/widgets/floating_buttons/geo_map_button.ts index 32b45d66c..945be41d1 100644 --- a/apps/client/src/widgets/floating_buttons/geo_map_button.ts +++ b/apps/client/src/widgets/floating_buttons/geo_map_button.ts @@ -23,7 +23,7 @@ const TPL = /*html*/`\ export default class GeoMapButtons extends NoteContextAwareWidget { isEnabled() { - return super.isEnabled() && this.note?.type === "geoMap"; + return super.isEnabled() && this.note?.getLabelValue("viewType") === "geoMap"; } doRender() { diff --git a/apps/client/src/widgets/note_list.ts b/apps/client/src/widgets/note_list.ts index 389aa82d3..54ba1a395 100644 --- a/apps/client/src/widgets/note_list.ts +++ b/apps/client/src/widgets/note_list.ts @@ -1,7 +1,7 @@ import NoteContextAwareWidget from "./note_context_aware_widget.js"; import NoteListRenderer from "../services/note_list_renderer.js"; import type FNote from "../entities/fnote.js"; -import type { CommandListener, CommandListenerData, CommandMappings, CommandNames, EventData } from "../components/app_context.js"; +import type { CommandListener, CommandListenerData, CommandMappings, CommandNames, EventData, EventNames } from "../components/app_context.js"; import type ViewMode from "./view_widgets/view_mode.js"; import AttributeDetailWidget from "./attribute_widgets/attribute_detail.js"; import { Attribute } from "../services/attribute_parser.js"; @@ -176,4 +176,15 @@ export default class NoteListWidget extends NoteContextAwareWidget { return super.triggerCommand(name, data); } + handleEventInChildren(name: T, data: EventData): Promise | null { + super.handleEventInChildren(name, data); + + if (this.viewMode) { + const ret = this.viewMode.handleEvent(name, data); + if (ret) { + return ret; + } + } + } + } diff --git a/apps/client/src/widgets/type_widgets/geo_map.ts b/apps/client/src/widgets/type_widgets/geo_map.ts index 20397089e..7cd02825b 100644 --- a/apps/client/src/widgets/type_widgets/geo_map.ts +++ b/apps/client/src/widgets/type_widgets/geo_map.ts @@ -11,8 +11,6 @@ import attributes from "../../services/attributes.js"; import link from "../../services/link.js"; -import { hasTouchBar } from "../../services/utils.js"; - const TPL = /*html*/`\