mirror of
				https://github.com/smartfrigde/armcord.git
				synced 2024-08-14 23:56:58 +00:00 
			
		
		
		
	Add dynamic vibe import only on windows (#227)
This commit is contained in:
		
							parent
							
								
									0c6e7f2a9a
								
							
						
					
					
						commit
						3696ebdba9
					
				
					 2 changed files with 12 additions and 10 deletions
				
			
		
							
								
								
									
										11
									
								
								src/utils.ts
									
										
									
									
									
								
							
							
						
						
									
										11
									
								
								src/utils.ts
									
										
									
									
									
								
							|  | @ -1,7 +1,6 @@ | |||
| import * as fs from "fs"; | ||||
| import {app, dialog} from "electron"; | ||||
| import path from "path"; | ||||
| import vibe from "@pyke/vibe"; | ||||
| export var firstRun: boolean; | ||||
| export var contentPath: string; | ||||
| export var transparency: boolean; | ||||
|  | @ -120,10 +119,12 @@ export async function injectElectronFlags() { | |||
|         default: | ||||
|             console.log("No performance modes set"); | ||||
|     } | ||||
|     if ((await getConfig("windowStyle")) == "transparent") { | ||||
|         console.log("Transparent mode enabled"); | ||||
|         vibe.setup(app); | ||||
|         transparency = true; | ||||
|     if ((await getConfig("windowStyle")) == "transparent" && process.platform === "win32") { | ||||
|         import("@pyke/vibe").then(vibe => { | ||||
|             console.log("Transparent mode enabled"); | ||||
|             vibe.setup(app); | ||||
|             transparency = true; | ||||
|         }); | ||||
|     } | ||||
| } | ||||
| export async function setLang(language: string) { | ||||
|  |  | |||
|  | @ -21,7 +21,6 @@ import startServer from "./socket"; | |||
| import contextMenu from "electron-context-menu"; | ||||
| import os from "os"; | ||||
| import {tray} from "./tray"; | ||||
| import vibe from "@pyke/vibe"; | ||||
| import {iconPath} from "./main"; | ||||
| export let mainWindow: BrowserWindow; | ||||
| export let inviteWindow: BrowserWindow; | ||||
|  | @ -51,10 +50,12 @@ contextMenu({ | |||
|     ] | ||||
| }); | ||||
| async function doAfterDefiningTheWindow() { | ||||
|     if (transparency) { | ||||
|         vibe.applyEffect(mainWindow, "acrylic"); | ||||
|         vibe.setDarkMode(mainWindow); | ||||
|         mainWindow.show(); | ||||
|     if (transparency && process.platform === "win32") { | ||||
|         import("@pyke/vibe").then(vibe => { | ||||
|             vibe.applyEffect(mainWindow, "acrylic"); | ||||
|             vibe.setDarkMode(mainWindow); | ||||
|             mainWindow.show(); | ||||
|         });     | ||||
|     } | ||||
|     var ignoreProtocolWarning = await getConfig("ignoreProtocolWarning"); | ||||
|     await checkIfConfigIsBroken(); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue