BoostIO / boost-releases

🚀 Boostnote app releases & changelog
https://boostnote.io/
412 stars 52 forks source link

Code block theme does not work after latest update #40

Open sharmasourabh opened 5 years ago

sharmasourabh commented 5 years ago

Version: 0.11.17 Version prior to update: 0.11.15 OS: Windows 10

After update to 0.11.17, code block theme stopped working. I am using the default theme for editor and overall UI, therefore found no issue with them. However, I saw, editor theme issue is already opened.

Analysis: I found that there is code change in main.js after v0.11.15 at following code block. A new theme check has been added. Theme path hold the full path of theme path, instead of relative path. Therefore, when it gets added to appPath, a wrong path location is formed. Therefore, code block theme does not reflect.

            key: 'GetCodeThemeLink',
        value: function GetCodeThemeLink(name) {
          var theme = _consts2.default.THEMES.find(function (theme) {
            return theme.name === name;
          });
          if (theme) {
            return appPath + '/' + theme.path;
          } else {
            return appPath + '/node_modules/codemirror/theme/elegant.css';
          }
        }

Fix: Returned value inside theme check should return the theme.path as shown below:

              ...
          if (theme) {
            return theme.path;
          } else {
              ...
solariz commented 5 years ago

Can Confirm that.

themattgabriel commented 5 years ago

Here's the workaround that worked for me.

  1. Go to %USERPROFILE%\AppData\Local\boost\app-0.11.17\resources\app\compiled.

  2. Edit main.js.

  3. Look for:

    path: path.join(directory.split(/\//g).slice(-3).join('/'), file),
  4. Change it to:

    path: path.join(CODEMIRROR_THEME_PATH, file),