Fix window size retention (#1612)

This commit is contained in:
Neodymium 2023-05-24 11:54:04 -07:00 committed by GitHub
parent eb814160fe
commit f629f0a851
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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);
}