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

Commit

Permalink
Fix cannot read property 'ratingCardDidRate2' of undefined on macOS (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
quanglam2807 authored Aug 30, 2021
1 parent 5af5f74 commit 6ea451d
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
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

0 comments on commit 6ea451d

Please sign in to comment.