Skip to content

High performance self-hosted photo and video management solution.

989 B
Raw Blame
<script lang="ts">
  import SettingSwitch from '#lib/components/shared-components/settings/SettingSwitch.svelte';
  import { authManager } from '#lib/managers/auth-manager.svelte.ts';
  import { handleError } from '#lib/utils/handle-error.ts';
  import { updateMyPreferences } from '@immich/sdk';
  import { onDestroy } from 'svelte';
  import { t } from 'svelte-i18n';

  let gCastEnabled = $state(authManager.authenticated && authManager.preferences.cast.gCastEnabled);

  onDestroy(async () => {
    try {
      const response = await updateMyPreferences({ userPreferencesUpdateDto: { cast: { gCastEnabled } } });
      authManager.setPreferences(response);
    } catch (error) {
      handleError(error, $t('errors.unable_to_update_settings'));
    }
  });
</script>

<div class="flex flex-col gap-4">
  <p>
    {$t('onboarding_privacy_description')}
  </p>

  <SettingSwitch title={$t('gcast_enabled')} subtitle={$t('gcast_enabled_description')} bind:checked={gCastEnabled} />
</div>