Skip to content
This repository was archived by the owner on Apr 29, 2022. It is now read-only.

Fix cannot read property 'ratingCardDidRate2' of undefined on macOS #346

Merged
merged 2 commits into from
Aug 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/linux-arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,5 @@ jobs:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REACT_APP_AMPLITUDE_API_KEY: ${{ secrets.REACT_APP_AMPLITUDE_API_KEY }}
REACT_APP_OCR_SPACE_API_KEY: ${{ secrets.REACT_APP_OCR_SPACE_API_KEY }}
ELECTRON_APP_SENTRY_DSN: ${{ secrets.ELECTRON_APP_SENTRY_DSN }}
ELECTRON_APP_SENTRY_DSN: ${{ secrets.ELECTRON_APP_SENTRY_DSN }}
if: startsWith(github.ref, 'refs/tags/')
3 changes: 2 additions & 1 deletion .github/workflows/linux-x64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,5 @@ jobs:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REACT_APP_AMPLITUDE_API_KEY: ${{ secrets.REACT_APP_AMPLITUDE_API_KEY }}
REACT_APP_OCR_SPACE_API_KEY: ${{ secrets.REACT_APP_OCR_SPACE_API_KEY }}
ELECTRON_APP_SENTRY_DSN: ${{ secrets.ELECTRON_APP_SENTRY_DSN }}
ELECTRON_APP_SENTRY_DSN: ${{ secrets.ELECTRON_APP_SENTRY_DSN }}
if: startsWith(github.ref, 'refs/tags/')
3 changes: 2 additions & 1 deletion .github/workflows/macos-mas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,5 @@ jobs:
REACT_APP_AMPLITUDE_API_KEY: ${{ secrets.REACT_APP_AMPLITUDE_API_KEY }}
REACT_APP_OCR_SPACE_API_KEY: ${{ secrets.REACT_APP_OCR_SPACE_API_KEY }}
ELECTRON_APP_SENTRY_DSN: ${{ secrets.ELECTRON_APP_SENTRY_DSN }}
SDKROOT: /Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk
SDKROOT: /Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk
if: startsWith(github.ref, 'refs/tags/')
3 changes: 2 additions & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,5 @@ jobs:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REACT_APP_AMPLITUDE_API_KEY: ${{ secrets.REACT_APP_AMPLITUDE_API_KEY }}
REACT_APP_OCR_SPACE_API_KEY: ${{ secrets.REACT_APP_OCR_SPACE_API_KEY }}
ELECTRON_APP_SENTRY_DSN: ${{ secrets.ELECTRON_APP_SENTRY_DSN }}
ELECTRON_APP_SENTRY_DSN: ${{ secrets.ELECTRON_APP_SENTRY_DSN }}
if: startsWith(github.ref, 'refs/tags/')
2 changes: 1 addition & 1 deletion main-src/libs/preferences.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const initCachedPreferences = () => {
// ratingCardDidRate2 is only reset on Windows & Linux
// so transfer old value (ratingCardDidRate) to new value on macOS
const savedPreferences = settings.getSync(`preferences.${v}`);
if (process.platform === 'darwin' && !savedPreferences.ratingCardDidRate2 && savedPreferences.ratingCardDidRate) {
if (process.platform === 'darwin' && savedPreferences && !savedPreferences.ratingCardDidRate2 && savedPreferences.ratingCardDidRate) {
savedPreferences.ratingCardDidRate2 = true;
}

Expand Down