fsavje / math-with-slack

Rendered math (MathJax) with Slack's desktop client
MIT License
433 stars 63 forks source link

Check if file exists, to deal with missing -lite file #27

Closed jeanluct closed 6 years ago

jeanluct commented 6 years ago

The newest version of slack-desktop for Linux (3.0.0) remove the ssb-interop-lite.js file.

Right now the script terminates, because it doesn't check if the file exists.

The small fix: check if file exists in both restore and inject functions. If file doesn't exist, then just silently return. This way the script works with both older slack-desktop versions and the newest one.

fsavje commented 6 years ago

Thank you @jeanluct for the bug fix. I decided to remove ssb-interop-lite.js completely as it isn't likely to make a reappearance. And the script already checks so ssb-interop.jsexists.