Skip to content

Commit

Permalink
feat: allow opening of Mapping Files via url with src query parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
mikecarenzo authored Feb 27, 2024
1 parent ac715c6 commit c8acf81
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/mappings_editor/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,17 @@ export default defineComponent({
}
// Load settings
this.application.execute(AppCommands.loadSettings(this.application, settings));
// Load file from query parameters, if possible
let params = new URLSearchParams(window.location.search);
let src = params.get("src");
if(src) {
try {
this.application.execute(await AppCommands.loadFileFromUrl(this.application, src));
} catch(ex) {
console.error(`Failed to load file from url: '${ src }'`);
console.error(ex);
}
}
},
mounted() {
this.bodyWidth = this.body!.clientWidth;
Expand Down

0 comments on commit c8acf81

Please sign in to comment.