mirror of
https://github.com/logseq/logseq.git
synced 2026-05-04 10:56:32 +00:00
fix: CI
This commit is contained in:
@@ -18,7 +18,6 @@
|
||||
[frontend.handler.user :as user]
|
||||
[frontend.state :as state]
|
||||
[frontend.mobile.util :as mobile-util]
|
||||
[frontend.mobile.core :as mobile-core]
|
||||
[frontend.util :as util]
|
||||
[frontend.util.persist-var :as persist-var]
|
||||
[frontend.util.fs :as fs-util]
|
||||
@@ -3183,7 +3182,7 @@
|
||||
(<! (<sync-local->remote-now))
|
||||
;; wait at most 20s
|
||||
(async/alts! [finished-local->remote-chan (timeout 20000)])
|
||||
(p/let [active? (mobile-core/app-active?)]
|
||||
(p/let [active? (mobile-util/app-active?)]
|
||||
(when-not active?
|
||||
(offer! pause-resume-chan is-active?)))
|
||||
(<! (timeout 5000))
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
"Main ns for handling mobile start"
|
||||
(:require ["@capacitor/app" :refer [^js App]]
|
||||
["@capacitor/keyboard" :refer [^js Keyboard]]
|
||||
["@capacitor/core" :refer [^js Plugins]]
|
||||
[clojure.string :as string]
|
||||
[promesa.core :as p]
|
||||
[frontend.fs.capacitor-fs :as capacitor-fs]
|
||||
@@ -12,9 +11,7 @@
|
||||
[frontend.mobile.util :as mobile-util]
|
||||
[frontend.state :as state]
|
||||
[frontend.util :as util]
|
||||
[cljs-bean.core :as bean]
|
||||
[goog.object :as gobj]))
|
||||
|
||||
[cljs-bean.core :as bean]))
|
||||
|
||||
(def *url (atom nil))
|
||||
;; FIXME: `appUrlOpen` are fired twice when receiving a same intent.
|
||||
@@ -99,13 +96,6 @@
|
||||
(editor-handler/save-current-block!))
|
||||
(state/set-mobile-app-state-change is-active?))))
|
||||
|
||||
(defn app-active?
|
||||
"Returns a promise"
|
||||
[]
|
||||
(let [app ^js (gobj/get Plugins "App")]
|
||||
(p/let [state (.getState app)]
|
||||
(gobj/get state "isActive"))))
|
||||
|
||||
(defn- general-init
|
||||
"Initialize event listeners used by both iOS and Android"
|
||||
[]
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
(ns frontend.mobile.util
|
||||
(:require ["@capacitor/core" :refer [Capacitor registerPlugin]]
|
||||
(:require ["@capacitor/core" :refer [Capacitor registerPlugin ^js Plugins]]
|
||||
["@capacitor/splash-screen" :refer [SplashScreen]]
|
||||
["@logseq/capacitor-file-sync" :refer [FileSync]]
|
||||
[clojure.string :as string]
|
||||
[promesa.core :as p]))
|
||||
[promesa.core :as p]
|
||||
[goog.object :as gobj]))
|
||||
|
||||
(defn platform []
|
||||
(.getPlatform Capacitor))
|
||||
@@ -93,3 +94,9 @@
|
||||
[path]
|
||||
(string/includes? path "iCloud~com~logseq~logseq"))
|
||||
|
||||
(defn app-active?
|
||||
"Whether the app is active. This function returns a promise."
|
||||
[]
|
||||
(let [app ^js (gobj/get Plugins "App")]
|
||||
(p/let [state (.getState app)]
|
||||
(gobj/get state "isActive"))))
|
||||
|
||||
Reference in New Issue
Block a user