Skip to content

Commit

Permalink
Upgrade for old default font family
Browse files Browse the repository at this point in the history
Signed-off-by: Philipp <philipp.koenig@redeviation.com>
  • Loading branch information
Kiuryy committed Mar 24, 2023
1 parent a059ef4 commit 64ba779
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "bookmark_sidebar",
"version": "2.0.0",
"versionName": "2.0.0",
"version": "2.0.1",
"versionName": "2.0.1",
"license": "GPL-3.0",
"author": "Philipp König",
"homepage": "https://extensions.redeviation.com/",
Expand All @@ -21,15 +21,15 @@
"create-file": "^1.0.1",
"del": "^7.0.0",
"eslint": "^8.36.0",
"fs-extra": "^11.1.0",
"fs-extra": "^11.1.1",
"glob-concat": "^1.0.3",
"html-minifier": "^4.0.0",
"jsonminify": "^0.4.2",
"sass": "^1.59.3",
"npm-check-updates": "^16.7.12",
"sass": "^1.60.0",
"npm-check-updates": "^16.8.0",
"read-file": "^0.2.0",
"request": "^2.88.2",
"terser": "^5.16.6",
"terser": "^5.16.8",
"zip-dir": "^2.0.0"
}
}
12 changes: 12 additions & 0 deletions src/js/background/upgrade.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,18 @@
delete obj.newtab.topPagesMaxRows;
delete obj.newtab.shortcutsPosition;
delete obj.newtab.shortcuts;

if (obj.appearance.styles && obj.appearance.styles.fontFamily && obj.appearance.styles.fontFamily.toUpperCase() === "DEFAULT") {
const existingFontFamily = obj.appearance.styles.fontFamily.toUpperCase();

if (existingFontFamily === "DEFAULT"
|| existingFontFamily === "ROBOTO"
|| existingFontFamily === "NOTO SANS SC"
|| existingFontFamily === "NOTO SANS TC"
|| existingFontFamily === "NOTO SANS JAPANESE") {
obj.appearance.styles.fontFamily = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif";
}
}
} catch (e) {
//
}
Expand Down
2 changes: 1 addition & 1 deletion src/js/helper/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@
tooltipFontSize: "9px",
overlayMaskColor: null,
overlayHeaderHeight: "50px",
fontFamily: "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial",
fontFamily: "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif",
// styles for glass theme
backgroundTransparency: 0.8,
backgroundBlur: "7px"
Expand Down

0 comments on commit 64ba779

Please sign in to comment.