Skip to content

Commit fa1a3f4

Browse files
committed
fix: Inspect document body for theme instead of vault config (close #440)
1 parent 1dc8676 commit fa1a3f4

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/map/map.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -321,10 +321,10 @@ export abstract class BaseMap extends Events implements BaseMapDefinition {
321321
mapLayers: LayerGroup<L.TileLayer | L.ImageOverlay>[] = [];
322322
get markerIcons(): Map<string, MarkerIcon> {
323323
return new Map(
324-
[...this.plugin.markerIcons, ...(this.options.localMarkerTypes ?? [])].map((markerIcon) => [
325-
markerIcon.type,
326-
markerIcon
327-
])
324+
[
325+
...this.plugin.markerIcons,
326+
...(this.options.localMarkerTypes ?? [])
327+
].map((markerIcon) => [markerIcon.type, markerIcon])
328328
);
329329
}
330330
get markerTypes() {
@@ -1481,10 +1481,9 @@ export class RealMap extends BaseMap {
14811481

14821482
this.log("Building initial map layer.");
14831483

1484-
const tileServer =
1485-
this.plugin.app.vault.config.theme == "moonstone"
1486-
? this.plugin.data.defaultTile
1487-
: this.plugin.data.defaultTileDark;
1484+
const tileServer = document.body.hasClass("theme-light")
1485+
? this.plugin.data.defaultTile
1486+
: this.plugin.data.defaultTileDark;
14881487

14891488
let osmLayer = {
14901489
id: "real",

0 commit comments

Comments
 (0)