Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: timed color scheme toast #978

Merged
merged 4 commits into from
Apr 15, 2022
Merged
Show file tree
Hide file tree
Changes from 3 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
8 changes: 3 additions & 5 deletions app/assets/javascripts/Services/ThemeManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ export class ThemeManager extends ApplicationService {
const themes = this.application.items.getDisplayableItems(ContentType.Theme) as SNTheme[]

const activeTheme = themes.find((theme) => theme.active && !theme.isLayerable())
const activeThemeIdentifier = activeTheme ? activeTheme.identifier : DefaultThemeIdentifier

const themeIdentifier = this.application.getPreference(
preference,
Expand All @@ -193,12 +194,9 @@ export class ThemeManager extends ApplicationService {
}
}

const isPreferredThemeNotActive = activeTheme?.identifier !== themeIdentifier
const isPreferredThemeNotActive = activeThemeIdentifier !== themeIdentifier

const isDefaultThemePreferredAndNotActive =
themeIdentifier === DefaultThemeIdentifier && activeTheme

if (isPreferredThemeNotActive && isDefaultThemePreferredAndNotActive) {
if (isPreferredThemeNotActive) {
this.showColorSchemeToast(setTheme)
}
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"@standardnotes/filepicker": "1.10.5",
"@standardnotes/sncrypto-web": "1.8.2",
"@standardnotes/snjs": "2.94.3",
"@standardnotes/stylekit": "5.22.0",
"@standardnotes/stylekit": "5.22.1",
"@zip.js/zip.js": "^2.4.7",
"mobx": "^6.5.0",
"mobx-react-lite": "^3.3.0",
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2508,10 +2508,10 @@
"@standardnotes/sncrypto-common" "^1.7.5"
"@standardnotes/utils" "^1.4.8"

"@standardnotes/[email protected].0":
version "5.22.0"
resolved "https://registry.yarnpkg.com/@standardnotes/stylekit/-/stylekit-5.22.0.tgz#9524f57bee328ff61336d9efcee5684f35430b94"
integrity sha512-u3ywcUS/CJEp04B8XQNVDFtELCyAkwlQr2KiXVVXs1jnuhdMYAbvgLhwZR4MqBrnvTKtHRyH0Ryxd6M32lv7ZA==
"@standardnotes/[email protected].1":
version "5.22.1"
resolved "https://registry.yarnpkg.com/@standardnotes/stylekit/-/stylekit-5.22.1.tgz#1e92b1e6428b0891047f9b7d91799203f12156aa"
integrity sha512-JDdO7o7Ik+tfdKoi/VsF7bR+ZTMO/f6dVSyxjbtIb/NCS7KM4apFMBVoZ+ARBXhbhpoBnwyVJHpZBkiB1p2Cjw==
dependencies:
"@nanostores/preact" "^0.1.3"
"@reach/listbox" "^0.16.2"
Expand Down