Disable updater until we can debug more in release (#2908)
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import { useState, useEffect, useRef } from 'react';
|
||||
import { Switch } from '../../ui/switch';
|
||||
import UpdateSection from './UpdateSection';
|
||||
import { UPDATES_ENABLED } from '../../../updates';
|
||||
|
||||
interface AppSettingsSectionProps {
|
||||
scrollToSection?: string;
|
||||
@@ -12,6 +11,7 @@ export default function AppSettingsSection({ scrollToSection }: AppSettingsSecti
|
||||
const [dockIconEnabled, setDockIconEnabled] = useState(true);
|
||||
const [isMacOS, setIsMacOS] = useState(false);
|
||||
const [isDockSwitchDisabled, setIsDockSwitchDisabled] = useState(false);
|
||||
const [updatesEnabled, setUpdatesEnabled] = useState(false);
|
||||
const updateSectionRef = useRef<HTMLDivElement>(null);
|
||||
|
||||
// Check if running on macOS
|
||||
@@ -19,6 +19,25 @@ export default function AppSettingsSection({ scrollToSection }: AppSettingsSecti
|
||||
setIsMacOS(window.electron.platform === 'darwin');
|
||||
}, []);
|
||||
|
||||
// Load updater state
|
||||
useEffect(() => {
|
||||
window.electron.getUpdaterEnabled().then((enabled) => {
|
||||
setUpdatesEnabled(enabled);
|
||||
});
|
||||
|
||||
// Listen for updater state changes
|
||||
const handleUpdaterStateChange = (enabled: boolean) => {
|
||||
setUpdatesEnabled(enabled);
|
||||
};
|
||||
|
||||
window.electron.onUpdaterStateChanged(handleUpdaterStateChange);
|
||||
|
||||
// Cleanup listener on unmount
|
||||
return () => {
|
||||
window.electron.removeUpdaterStateListener(handleUpdaterStateChange);
|
||||
};
|
||||
}, []);
|
||||
|
||||
// Handle scrolling to update section
|
||||
useEffect(() => {
|
||||
if (scrollToSection === 'update' && updateSectionRef.current) {
|
||||
@@ -125,7 +144,7 @@ export default function AppSettingsSection({ scrollToSection }: AppSettingsSecti
|
||||
</div>
|
||||
|
||||
{/* Update Section */}
|
||||
{UPDATES_ENABLED && (
|
||||
{updatesEnabled && (
|
||||
<div ref={updateSectionRef} className="mt-8 pt-8 border-t border-gray-200">
|
||||
<UpdateSection />
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user