mirror of
https://github.com/ccmdi/obsidian-map-plus.git
synced 2026-07-22 06:43:14 +00:00
refactor: timline refresh logic
This commit is contained in:
parent
0210388e46
commit
181b3bea1e
2 changed files with 7 additions and 5 deletions
|
|
@ -55,10 +55,7 @@ export class MapBasesView extends BasesView {
|
|||
|
||||
this.register(
|
||||
this.containerEl.onWindowMigrated(() => {
|
||||
if (this.deck) {
|
||||
this.destroyMap();
|
||||
this.renderMap();
|
||||
}
|
||||
this.refresh();
|
||||
})
|
||||
);
|
||||
}
|
||||
|
|
@ -515,6 +512,7 @@ export class MapBasesView extends BasesView {
|
|||
const stringData = value.toString().trim();
|
||||
// Try to parse as JSON array
|
||||
try {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
const parsed = JSON.parse(stringData);
|
||||
if (Array.isArray(parsed)) {
|
||||
const coords: [number, number][] = [];
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ import {
|
|||
import { MapPoint } from '../map-renderer';
|
||||
import MapPlugin from '../main';
|
||||
import { MapBasesView } from './map-bases-view';
|
||||
import { updateMapPoints } from '../map-renderer';
|
||||
|
||||
export const MapTimelineBasesViewType = 'map-timeline';
|
||||
const MAP_UPDATE_DEBOUNCE_TIME = 50;
|
||||
|
|
@ -56,6 +55,11 @@ export class MapTimelineBasesView extends MapBasesView {
|
|||
this.destroySlider();
|
||||
}
|
||||
|
||||
refresh(): void {
|
||||
this.destroySlider();
|
||||
super.refresh();
|
||||
}
|
||||
|
||||
private createSlider(): void {
|
||||
const sliderContainer = this.mapEl.createDiv({ cls: 'bases-timeline-slider' });
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue