Check for UPDATES_ENABLED flag before running update logic or in ui (#2897)
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
import { useState, useEffect, useRef } from 'react';
|
import { useState, useEffect, useRef } from 'react';
|
||||||
import { Switch } from '../../ui/switch';
|
import { Switch } from '../../ui/switch';
|
||||||
import UpdateSection from './UpdateSection';
|
import UpdateSection from './UpdateSection';
|
||||||
|
import { UPDATES_ENABLED } from '../../../updates';
|
||||||
|
|
||||||
interface AppSettingsSectionProps {
|
interface AppSettingsSectionProps {
|
||||||
scrollToSection?: string;
|
scrollToSection?: string;
|
||||||
@@ -124,9 +125,11 @@ export default function AppSettingsSection({ scrollToSection }: AppSettingsSecti
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Update Section */}
|
{/* Update Section */}
|
||||||
<div ref={updateSectionRef} className="mt-8 pt-8 border-t border-gray-200">
|
{UPDATES_ENABLED && (
|
||||||
<UpdateSection />
|
<div ref={updateSectionRef} className="mt-8 pt-8 border-t border-gray-200">
|
||||||
</div>
|
<UpdateSection />
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ import {
|
|||||||
updateTrayMenu,
|
updateTrayMenu,
|
||||||
getUpdateAvailable,
|
getUpdateAvailable,
|
||||||
} from './utils/autoUpdater';
|
} from './utils/autoUpdater';
|
||||||
|
import { UPDATES_ENABLED } from './updates';
|
||||||
|
|
||||||
// Define temp directory for pasted images
|
// Define temp directory for pasted images
|
||||||
const gooseTempDir = path.join(app.getPath('temp'), 'goose-pasted-images');
|
const gooseTempDir = path.join(app.getPath('temp'), 'goose-pasted-images');
|
||||||
@@ -1157,7 +1158,7 @@ const registerGlobalHotkey = (accelerator: string) => {
|
|||||||
|
|
||||||
app.whenReady().then(async () => {
|
app.whenReady().then(async () => {
|
||||||
// Setup auto-updater
|
// Setup auto-updater
|
||||||
setupAutoUpdater();
|
UPDATES_ENABLED && setupAutoUpdater();
|
||||||
|
|
||||||
// Add CSP headers to all sessions
|
// Add CSP headers to all sessions
|
||||||
session.defaultSession.webRequest.onHeadersReceived((details, callback) => {
|
session.defaultSession.webRequest.onHeadersReceived((details, callback) => {
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
export const UPDATES_ENABLED = true;
|
||||||
Reference in New Issue
Block a user