Load markers when ready, and from incoming changes
This commit is contained in:
@@ -67,18 +67,21 @@ export default class MapComponent extends Component {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Load initial bookmarks
|
// Load initial bookmarks
|
||||||
this.loadBookmarks();
|
this.storage.rs.on('ready', () => {
|
||||||
|
|
||||||
// Listen for remote storage changes
|
|
||||||
this.storage.rs.on('connected', () => {
|
|
||||||
this.loadBookmarks();
|
this.loadBookmarks();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Listen for remote storage changes
|
||||||
|
// this.storage.rs.on('connected', () => {
|
||||||
|
// this.loadBookmarks();
|
||||||
|
// });
|
||||||
|
|
||||||
// Listen to changes in the /places/ scope
|
// Listen to changes in the /places/ scope
|
||||||
// keeping this as a backup or for future real-time sync support
|
// keeping this as a backup or for future real-time sync support
|
||||||
this.storage.rs.scope('/places/').on('change', (event) => {
|
this.storage.rs.scope('/places/').on('change', (event) => {
|
||||||
console.log('RemoteStorage change detected:', event);
|
console.log('RemoteStorage change detected:', event);
|
||||||
// this.loadBookmarks(); // Disabling auto-update for now per instructions, using explicit version action instead
|
// this.loadBookmarks(); // Disabling auto-update for now per instructions, using explicit version action instead
|
||||||
|
this.loadBookmarks();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user