File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -74,14 +74,24 @@ export default {
7474 this .state .logType = ' tlog'
7575 } else {
7676 url = file
77+ // Set the file name for display purposes
78+ const urlParts = url .split (' /' )
79+ this .state .file = urlParts[urlParts .length - 1 ]
7780 }
7881 const oReq = new XMLHttpRequest ()
7982 console .log (` loading file from ${ url} ` )
83+
84+ // Set the log type based on file extension
8085 this .state .logType = url .indexOf (' .tlog' ) > 0 ? ' tlog' : ' bin'
86+ if (url .indexOf (' .txt' ) > 0 ) {
87+ this .state .logType = ' dji'
88+ }
89+
8190 oReq .open (' GET' , url, true )
8291 oReq .responseType = ' arraybuffer'
8392
84- oReq .onload = function (oEvent ) {
93+ // Use arrow function to preserve 'this' context
94+ oReq .onload = (oEvent ) => {
8595 const arrayBuffer = oReq .response
8696
8797 this .transferMessage = ' Download Done'
@@ -252,7 +262,7 @@ export default {
252262 }
253263 const url = document .location .search .split (' ?file=' )[1 ]
254264 if (url) {
255- this .onLoadSample (url)
265+ this .onLoadSample (decodeURIComponent ( url) )
256266 }
257267 },
258268 components: {
You can’t perform that action at this time.
0 commit comments