Ver código fonte

Revert "Enhance (UX): Electron loading (#10049)" (#10165)

This reverts commit 12642f57771596e18a0ace95faef4bd535d4bc5a.
Andelf 2 anos atrás
pai
commit
9e2fe79c48

+ 0 - 5
src/electron/electron/handler.cljs

@@ -6,7 +6,6 @@
             ["buffer" :as buffer]
             ["diff-match-patch" :as google-diff]
             ["electron" :refer [app autoUpdater dialog ipcMain shell]]
-            ["electron-window-state" :as windowStateKeeper]
             ["fs" :as fs]
             ["fs-extra" :as fs-extra]
             ["os" :as os]
@@ -619,10 +618,6 @@
 (defmethod handle :window-close [^js win]
   (.close win))
 
-(defmethod handle :theme-loaded [^js win]
-  (.manage (windowStateKeeper) win)
-  (.show win))
-
 ;;;;;;;;;;;;;;;;;;;;;;;
 ;; file-sync-rs-apis ;;
 ;;;;;;;;;;;;;;;;;;;;;;;

+ 1 - 1
src/electron/electron/window.cljs

@@ -35,7 +35,6 @@
                       :titleBarStyle        "hiddenInset"
                       :trafficLightPosition {:x 16 :y 16}
                       :autoHideMenuBar      (not mac?)
-                      :show                 false
                       :webPreferences
                       {:plugins                 true        ; pdf
                        :nodeIntegration         false
@@ -56,6 +55,7 @@
                      linux?
                      (assoc :icon (node-path/join js/__dirname "icons/logseq.png")))
          win       (BrowserWindow. (clj->js win-opts))]
+     (.manage win-state win)
      (.onBeforeSendHeaders (.. session -defaultSession -webRequest)
                            (clj->js {:urls (array "*://*.youtube.com/*")})
                            (fn [^js details callback]

+ 2 - 4
src/main/frontend/components/theme.cljs

@@ -1,6 +1,5 @@
 (ns frontend.components.theme
-  (:require [electron.ipc :as ipc]
-            [frontend.extensions.pdf.core :as pdf]
+  (:require [frontend.extensions.pdf.core :as pdf]
             [frontend.config :as config]
             [frontend.handler.plugin :as plugin-handler]
             [frontend.handler.plugin-config :as plugin-config-handler]
@@ -34,8 +33,7 @@
 
     (rum/use-effect!
      #(let [doc js/document.documentElement]
-        (.setAttribute doc "lang" preferred-language)
-        (js/setTimeout (fn [] (ipc/ipc "theme-loaded")) 100))) ; Wait for the theme to be applied
+        (.setAttribute doc "lang" preferred-language)))
 
     (rum/use-effect!
      #(when (and restored-sidebar?