Disabled autoupdater for now
This commit is contained in:
		
							parent
							
								
									8f9bccf11c
								
							
						
					
					
						commit
						d88e1e98ab
					
				@ -74,7 +74,7 @@ const spellchecker = new sc.Spellchecker();*/
 | 
				
			|||||||
Axios.defaults.params = {__fchat: `desktop/${electron.remote.app.getVersion()}`};
 | 
					Axios.defaults.params = {__fchat: `desktop/${electron.remote.app.getVersion()}`};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if(process.env.NODE_ENV === 'production') {
 | 
					if(process.env.NODE_ENV === 'production') {
 | 
				
			||||||
    setupRaven('https://a9239b17b0a14f72ba85e8729b9d1612@sentry.f-list.net/2', electron.remote.app.getVersion());
 | 
					    // setupRaven('https://a9239b17b0a14f72ba85e8729b9d1612@sentry.f-list.net/2', electron.remote.app.getVersion());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    electron.remote.getCurrentWebContents().on('devtools-opened', () => {
 | 
					    electron.remote.getCurrentWebContents().on('devtools-opened', () => {
 | 
				
			||||||
        console.log(`%c${l('consoleWarning.head')}`, 'background: red; color: yellow; font-size: 30pt');
 | 
					        console.log(`%c${l('consoleWarning.head')}`, 'background: red; color: yellow; font-size: 30pt');
 | 
				
			||||||
 | 
				
			|||||||
@ -306,41 +306,41 @@ function onReady(): void {
 | 
				
			|||||||
        setGeneralSettings(settings);
 | 
					        setGeneralSettings(settings);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    const updaterUrl = `https://client.f-list.net/${process.platform}`;
 | 
					    // const updaterUrl = `https://client.f-list.net/${process.platform}`;
 | 
				
			||||||
    if(process.env.NODE_ENV === 'production') {
 | 
					    // if(process.env.NODE_ENV === 'production') {
 | 
				
			||||||
        electron.autoUpdater.setFeedURL({url: updaterUrl + (settings.beta ? '?channel=beta' : ''), serverType: 'json'});
 | 
					    //     electron.autoUpdater.setFeedURL({url: updaterUrl + (settings.beta ? '?channel=beta' : ''), serverType: 'json'});
 | 
				
			||||||
        setTimeout(() => electron.autoUpdater.checkForUpdates(), 10000);
 | 
					    //     setTimeout(() => electron.autoUpdater.checkForUpdates(), 10000);
 | 
				
			||||||
        const updateTimer = setInterval(() => electron.autoUpdater.checkForUpdates(), 3600000);
 | 
					    //     const updateTimer = setInterval(() => electron.autoUpdater.checkForUpdates(), 3600000);
 | 
				
			||||||
        electron.autoUpdater.on('update-downloaded', () => {
 | 
					    //     electron.autoUpdater.on('update-downloaded', () => {
 | 
				
			||||||
            clearInterval(updateTimer);
 | 
					    //         clearInterval(updateTimer);
 | 
				
			||||||
            const menu = electron.Menu.getApplicationMenu()!;
 | 
					    //         const menu = electron.Menu.getApplicationMenu()!;
 | 
				
			||||||
            const item = menu.getMenuItemById('update') as MenuItem | null;
 | 
					    //         const item = menu.getMenuItemById('update') as MenuItem | null;
 | 
				
			||||||
            if(item !== null) item.visible = true;
 | 
					    //         if(item !== null) item.visible = true;
 | 
				
			||||||
            else
 | 
					    //         else
 | 
				
			||||||
                menu.append(new electron.MenuItem({
 | 
					    //             menu.append(new electron.MenuItem({
 | 
				
			||||||
                    label: l('action.updateAvailable'),
 | 
					    //                 label: l('action.updateAvailable'),
 | 
				
			||||||
                    submenu: electron.Menu.buildFromTemplate([{
 | 
					    //                 submenu: electron.Menu.buildFromTemplate([{
 | 
				
			||||||
                        label: l('action.update'),
 | 
					    //                     label: l('action.update'),
 | 
				
			||||||
                        click: () => {
 | 
					    //                     click: () => {
 | 
				
			||||||
                            for(const w of windows) w.webContents.send('quit');
 | 
					    //                         for(const w of windows) w.webContents.send('quit');
 | 
				
			||||||
                            electron.autoUpdater.quitAndInstall();
 | 
					    //                         electron.autoUpdater.quitAndInstall();
 | 
				
			||||||
                        }
 | 
					    //                     }
 | 
				
			||||||
                    }, {
 | 
					    //                 }, {
 | 
				
			||||||
                        label: l('help.changelog'),
 | 
					    //                     label: l('help.changelog'),
 | 
				
			||||||
                        click: showPatchNotes
 | 
					    //                     click: showPatchNotes
 | 
				
			||||||
                    }]),
 | 
					    //                 }]),
 | 
				
			||||||
                    id: 'update'
 | 
					    //                 id: 'update'
 | 
				
			||||||
                }));
 | 
					    //             }));
 | 
				
			||||||
            electron.Menu.setApplicationMenu(menu);
 | 
					    //         electron.Menu.setApplicationMenu(menu);
 | 
				
			||||||
            for(const w of windows) w.webContents.send('update-available', true);
 | 
					    //         for(const w of windows) w.webContents.send('update-available', true);
 | 
				
			||||||
        });
 | 
					    //     });
 | 
				
			||||||
        electron.autoUpdater.on('update-not-available', () => {
 | 
					    //     electron.autoUpdater.on('update-not-available', () => {
 | 
				
			||||||
            for(const w of windows) w.webContents.send('update-available', false);
 | 
					    //         for(const w of windows) w.webContents.send('update-available', false);
 | 
				
			||||||
            const item = electron.Menu.getApplicationMenu()!.getMenuItemById('update') as MenuItem | null;
 | 
					    //         const item = electron.Menu.getApplicationMenu()!.getMenuItemById('update') as MenuItem | null;
 | 
				
			||||||
            if(item !== null) item.visible = false;
 | 
					    //         if(item !== null) item.visible = false;
 | 
				
			||||||
        });
 | 
					    //     });
 | 
				
			||||||
        electron.autoUpdater.on('error', (e) => log.error(e));
 | 
					    //     electron.autoUpdater.on('error', (e) => log.error(e));
 | 
				
			||||||
    }
 | 
					    // }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    const viewItem = {
 | 
					    const viewItem = {
 | 
				
			||||||
        label: `&${l('action.view')}`,
 | 
					        label: `&${l('action.view')}`,
 | 
				
			||||||
@ -429,8 +429,8 @@ function onReady(): void {
 | 
				
			|||||||
                    click: async(item: Electron.MenuItem) => {
 | 
					                    click: async(item: Electron.MenuItem) => {
 | 
				
			||||||
                        settings.beta = item.checked;
 | 
					                        settings.beta = item.checked;
 | 
				
			||||||
                        setGeneralSettings(settings);
 | 
					                        setGeneralSettings(settings);
 | 
				
			||||||
                        electron.autoUpdater.setFeedURL({url: updaterUrl + (item.checked ? '?channel=beta' : ''), serverType: 'json'});
 | 
					                        // electron.autoUpdater.setFeedURL({url: updaterUrl + (item.checked ? '?channel=beta' : ''), serverType: 'json'});
 | 
				
			||||||
                        return electron.autoUpdater.checkForUpdates();
 | 
					                        // return electron.autoUpdater.checkForUpdates();
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                }, {
 | 
					                }, {
 | 
				
			||||||
                    label: l('fixLogs.action'),
 | 
					                    label: l('fixLogs.action'),
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user