Преглед изворни кода

fix: middle icon click & modal close

banxia пре 1 месец
родитељ
комит
ce3ee6721e
2 измењених фајлова са 8 додато и 1 уклоњено
  1. 4 0
      electron/win/mainWin.ts
  2. 4 1
      src/components/MessageModal/MessageModal.tsx

+ 4 - 0
electron/win/mainWin.ts

@@ -115,6 +115,10 @@ function maximizeMainWin() {
 }
 
 function middleMainWin() {
+  if (mainWindow?.isMaximized()) {
+    mainWindow.unmaximize();
+  }
+  
   const { width } = screen.getPrimaryDisplay().workAreaSize;
   const currentWidth = mainWindow?.getBounds().width;
   if (currentWidth && currentWidth > 420) {

+ 4 - 1
src/components/MessageModal/MessageModal.tsx

@@ -68,7 +68,10 @@ const MessageModal: React.FC<MessageModalProps> = ({
       onCancel={onClose}
       footer={null}
       width={600}
-      style={{ top: 10 }}
+      styles={{
+        body: { maxHeight: 'calc(90vh - 110px)', overflow: 'auto' },
+        wrapper: { top: 40, maxHeight: '90vh' }
+      }}
     >
       <div className="flex flex-col">
         <Tabs