Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set a flag variable that indicates Electron use
This will enable us to do certain things differently in the Electron version of MetagenomeScope (e.g. interact with Node.js' sqlite3 module instead of sql.js), without having to actually modify the JS code between the versions. The variable's name is METAGENOMESCOPE_ELECTRON_BEING_USED, for reference. An aside, which I already sort of knew about but realized more clearly as I read up on global variables in JS: using globals as much as MetagenomeScope's viewer interface does is not a good idea! It looks like the general solution for web apps which have to maintain least some persistent storage in a page instance is to create a namespace (which is, itself, a JS object that is a single global variable), and then just declare every global variable as an attribute of that object. That way, the only namespace collision we'd need to worry about would be the main namespace name. This isn't a significant problem now, but it's worth registering as its own issue. So I'm gonna go do that.
- Loading branch information