Fix window size retention

This commit is contained in:
Neodymium 2023-04-14 17:06:54 -07:00
parent 022b8fa380
commit 046128bda4
1 changed files with 1 additions and 1 deletions

View File

@ -15,7 +15,7 @@ export default new class RemoveMinimumSize extends Builtin {
window.addEventListener("resize", this.onResize);
const winprefs = DataStore.getData("windowprefs");
if (!winprefs.height || !winprefs.width) return; // If the values don't exist exit
if (!winprefs.height || !winprefs.width) return DataStore.setData("windowprefs", {}); // If the values don't exist exit and initialize
if ((winprefs.height >= DISCORD_MIN_HEIGHT) && (winprefs.width >= DISCORD_MIN_WIDTH)) return; // If both values are normally valid don't touch
IPC.setWindowSize(winprefs.width, winprefs.height);
}