Fix window size retention (#1612)
This commit is contained in:
parent
eb814160fe
commit
f629f0a851
|
@ -15,7 +15,7 @@ export default new class RemoveMinimumSize extends Builtin {
|
||||||
window.addEventListener("resize", this.onResize);
|
window.addEventListener("resize", this.onResize);
|
||||||
|
|
||||||
const winprefs = DataStore.getData("windowprefs");
|
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
|
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);
|
IPC.setWindowSize(winprefs.width, winprefs.height);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue