Skip to content

Commit

Permalink
fix export downloaded multiple times (#9)
Browse files Browse the repository at this point in the history
* fix export downloaded multiple times

* better
  • Loading branch information
ETLaurent committed Aug 29, 2023
1 parent 552a832 commit f78cd6d
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions ui/apos/apps/index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
export default () => {
window.apos.util.onReady(openExportUrl);
let ready = false;

function openExportUrl() {
window.apos.bus && window.apos.bus.$on('export-download', event => {
if (!event.url) {
return;
}
window.apos.util.onReady(() => {
if (!ready) {
ready = true;
window.apos.bus.$on('export-download', openUrl);
}
});

function openUrl(event) {
if (event.url) {
window.open(event.url, '_blank');
});
}
}
};

0 comments on commit f78cd6d

Please sign in to comment.