From 8fa4c05999d0095b188f82c5954d672501dc762f Mon Sep 17 00:00:00 2001 From: Jean Ouina Date: Tue, 9 Mar 2021 20:14:58 +0100 Subject: [PATCH] tabs fix !??!?!??? what ? :flushed: --- modules/discord_desktop_core/core/app/mainScreen.js | 12 +++++++++++- package.json | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/modules/discord_desktop_core/core/app/mainScreen.js b/modules/discord_desktop_core/core/app/mainScreen.js index f978bbc..172436b 100644 --- a/modules/discord_desktop_core/core/app/mainScreen.js +++ b/modules/discord_desktop_core/core/app/mainScreen.js @@ -141,13 +141,19 @@ function getSanitizedProtocolPath(url_) { const WEBAPP_PATH = settings.get('WEBAPP_PATH', `/app?_=${Date.now()}`); -const URL_TO_LOAD = `${WEBAPP_ENDPOINT}${WEBAPP_PATH}`; +let URL_TO_LOAD = `${WEBAPP_ENDPOINT}${WEBAPP_PATH}`; +if(WEBAPP_ENDPOINT.startsWith("file://")){ + URL_TO_LOAD = `${WEBAPP_ENDPOINT}?path=${encodeURIComponent(WEBAPP_PATH)}`; +} const MIN_WIDTH = settings.get('MIN_WIDTH', 940); const MIN_HEIGHT = settings.get('MIN_HEIGHT', 500); const DEFAULT_WIDTH = 1280; const DEFAULT_HEIGHT = 720; // TODO: document this var's purpose const MIN_VISIBLE_ON_SCREEN = 32; +/** + * @type {Electron.BrowserWindow} + */ let mainWindow = null; let mainWindowId = _Constants.DEFAULT_MAIN_WINDOW_ID; let mainWindowInitialPath = null; @@ -418,6 +424,9 @@ function launchMainAppWindow(isVisible) { mainWindow.destroy(); } + /** + * @type {Electron.BrowserWindowConstructorOptions} + */ const mainWindowOptions = { title: 'Lightcord', width: DEFAULT_WIDTH, @@ -462,6 +471,7 @@ function launchMainAppWindow(isVisible) { mainWindow = new BrowserWindow(mainWindowOptions); mainWindowId = mainWindow.id; global.mainWindowId = mainWindowId; + mainWindow.webContents.openDevTools() if(useGlasstron)setDefaultBlur() diff --git a/package.json b/package.json index 08d3b5a..e3924b1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lightcord", - "version": "0.1.4", + "version": "0.1.5", "description": "A simple - customizable - Discord Client.", "main": "dist/index.js", "scripts": {