Przeglądaj źródła

improve(plugin): support relaunch app when enable plugin system

charlie 4 lat temu
rodzic
commit
82699ee405

+ 3 - 1
src/main/frontend/components/settings.cljs

@@ -419,7 +419,9 @@
                       (fn []
                         (let [mode (not developer-mode?)]
                           (state/set-developer-mode! mode)
-                          (and mode (js/alert (t :developer-mode-alert)))))
+                          (and mode (util/electron?)
+                               (if (js/confirm (t :developer-mode-alert))
+                                 (js/logseq.api.relaunch)))))
                       true)]]]
         [:div.text-sm.opacity-50
          (t :settings-page/developer-mode-desc)]

+ 2 - 2
src/main/frontend/dicts.cljs

@@ -261,7 +261,7 @@
         :settings "Settings"
         :plugins "Plugins"
         :themes "Themes"
-        :developer-mode-alert "You need to restart the app to enable the plugin system."
+        :developer-mode-alert "You need to restart the app to enable the plugin system. Do it right now?"
         :import "Import"
         :join-community "Join the community"
         :sponsor-us "Sponsor Us"
@@ -915,7 +915,7 @@
            :settings "设置"
            :plugins "插件"
            :themes "主题"
-           :developer-mode-alert "如果希望插件功能立刻生效, 请重启应用"
+           :developer-mode-alert "如果希望插件功能立刻生效, 请重启应用。是否现在重启?"
            :import "导入"
            :join-community "加入社区"
            :sponsor-us "赞助我们!"