Skip to content

Commit

Permalink
fix: don't get backups settings if there is no logged-in user (#842)
Browse files Browse the repository at this point in the history
* fix: don't get backups settings if there is no logged-in user

* chore: bump snjs version
  • Loading branch information
vardan-arm authored Feb 2, 2022
1 parent d17edfc commit 616b77a
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ export const EmailBackups = observer(({ application }: Props) => {
useState(false);

const loadEmailFrequencySetting = useCallback(async () => {
if (!application.getUser()) {
return;
}
setIsLoading(true);

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,9 @@ export const CloudBackupProvider: FunctionComponent<Props> = ({
};

const getIntegrationStatus = useCallback(async () => {
if (!application.getUser()) {
return;
}
const frequency = await application.getSetting(backupFrequencySettingName);
setBackupFrequency(frequency);
}, [application, backupFrequencySettingName]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,7 @@ import { HorizontalSeparator } from '@/components/shared/HorizontalSeparator';
import { FeatureIdentifier } from '@standardnotes/features';
import { FeatureStatus } from '@standardnotes/snjs';
import { FunctionComponent } from 'preact';
import {
CloudProvider,
EmailBackupFrequency,
SettingName,
} from '@standardnotes/settings';
import { CloudProvider, SettingName } from '@standardnotes/settings';
import { Switch } from '@/components/Switch';
import { convertStringifiedBooleanToBoolean } from '@/utils';
import { STRING_FAILED_TO_UPDATE_USER_SETTING } from '@/strings';
Expand Down Expand Up @@ -46,6 +42,9 @@ export const CloudLink: FunctionComponent<Props> = ({ application }) => {
const [isLoading, setIsLoading] = useState(false);

const loadIsFailedCloudBackupEmailMutedSetting = useCallback(async () => {
if (!application.getUser()) {
return;
}
setIsLoading(true);

try {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"@reach/tooltip": "^0.16.2",
"@standardnotes/components": "1.4.4",
"@standardnotes/features": "1.26.1",
"@standardnotes/snjs": "2.49.2",
"@standardnotes/snjs": "2.49.4",
"@standardnotes/settings": "^1.11.2",
"@standardnotes/sncrypto-web": "1.6.2",
"mobx": "^6.3.5",
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2663,10 +2663,10 @@
buffer "^6.0.3"
libsodium-wrappers "^0.7.9"

"@standardnotes/[email protected].2":
version "2.49.2"
resolved "https://registry.yarnpkg.com/@standardnotes/snjs/-/snjs-2.49.2.tgz#8b0236ea522a227c01054f5d0e3ef3439c9db9ac"
integrity sha512-YgmcD7zJmaamy4GxbXywxf8T2LV/K3Mvu+4Ql5ocuAcNkGlRFb1Vp8XVg++Bu8a3s689rRgLZj3ZI0W024wBJQ==
"@standardnotes/[email protected].4":
version "2.49.4"
resolved "https://registry.yarnpkg.com/@standardnotes/snjs/-/snjs-2.49.4.tgz#ae443f0f3d8f72a4f7e65fe47e2030bcc6df9fab"
integrity sha512-RXyUNVvcT2TtGSYC32fDXgGUZdSiUvOFosLDWWGeY5kwOTnj1ZHrqmKaUlKCGPi1xiYANay42+EwLCLyyqOkzQ==
dependencies:
"@standardnotes/auth" "^3.15.3"
"@standardnotes/common" "^1.8.0"
Expand Down

0 comments on commit 616b77a

Please sign in to comment.