fix: don't get backups settings if there is no logged-in user (#842)
* fix: don't get backups settings if there is no logged-in user * chore: bump snjs version
This commit is contained in:
@@ -38,6 +38,9 @@ export const EmailBackups = observer(({ application }: Props) => {
|
||||
useState(false);
|
||||
|
||||
const loadEmailFrequencySetting = useCallback(async () => {
|
||||
if (!application.getUser()) {
|
||||
return;
|
||||
}
|
||||
setIsLoading(true);
|
||||
|
||||
try {
|
||||
|
||||
@@ -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]);
|
||||
|
||||
@@ -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';
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user