Skip to content

Commit

Permalink
fix: reload data fix
Browse files Browse the repository at this point in the history
  • Loading branch information
farfromrefug committed Jun 10, 2022
1 parent 0787af3 commit bbbc9f2
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/components/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@
);
unlistenerReload = await listen<{ message: string }>('reload-mbtiles', (event) => {
// console.log('reload-mbtiles', event.payload.message);
// let mapToRefresh = event.payload.message === 'secondary' ? secondaryMap : map;
[mainMap, secondaryMap].forEach(reloadMap);
});
Expand All @@ -109,15 +107,18 @@
mapToRefresh.triggerRepaint();
}
async function reloadMBtiles() {
[mainMap, secondaryMap].forEach(reloadMap);
mainSources.forEach((source) => {
console.log('reloadMBtiles', source.path);
invoke('reload_mbtiles', {
removeDataSource('main', source);
invoke('setup_mbtiles', {
key: 'main',
path: source.path,
});
});
secondarySources.forEach((source) => {
console.log('reloadMBtiles', source.path);
invoke('reload_mbtiles', {
removeDataSource('secondary', source);
invoke('setup_mbtiles', {
key: 'secondary',
path: source.path,
});
});
Expand Down

0 comments on commit bbbc9f2

Please sign in to comment.