Fix window size retention (#1612)

This commit is contained in:
2023-05-24 11:54:04 -07:00
parent 70851a9d2c
commit fdab9fb602
@@ -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);
}