mirror of
https://github.com/logseq/logseq.git
synced 2026-04-24 22:25:01 +00:00
enhance(plugin): app proxy call
This commit is contained in:
@@ -145,6 +145,7 @@ export interface AppUserInfo {
|
||||
|
||||
export interface AppInfo {
|
||||
version: string
|
||||
supportDb: boolean
|
||||
|
||||
[key: string]: unknown
|
||||
}
|
||||
|
||||
@@ -734,7 +734,8 @@ export class LSPluginUser
|
||||
|
||||
return function (this: any, ...args: any) {
|
||||
if (origMethod) {
|
||||
const ret = origMethod.apply(that, args.concat(tag))
|
||||
if (args?.length !== 0) args.concat(tag)
|
||||
const ret = origMethod.apply(that, args)
|
||||
if (ret !== PROXY_CONTINUE) return ret
|
||||
}
|
||||
|
||||
@@ -817,11 +818,15 @@ export class LSPluginUser
|
||||
return this._execCallableAPIAsync(`_callMainWin`, ...args)
|
||||
}
|
||||
|
||||
// User Proxies
|
||||
#appProxy: IAppProxy
|
||||
|
||||
/**
|
||||
* The interface methods of {@link IAppProxy}
|
||||
*/
|
||||
get App (): IAppProxy {
|
||||
return this._makeUserProxy(app, 'app')
|
||||
if (this.#appProxy) return this.#appProxy
|
||||
return (this.#appProxy = this._makeUserProxy(app, 'app'))
|
||||
}
|
||||
|
||||
get Editor (): IEditorProxy {
|
||||
|
||||
@@ -128,9 +128,10 @@
|
||||
(defn ^:export get_app_info
|
||||
;; get app base info
|
||||
[]
|
||||
(bean/->js
|
||||
(sdk-utils/normalize-keyword-for-json
|
||||
{:version fv/version})))
|
||||
(-> (sdk-utils/normalize-keyword-for-json
|
||||
{:version fv/version
|
||||
:supportDb true})
|
||||
(bean/->js)))
|
||||
|
||||
(def ^:export get_user_configs
|
||||
(fn []
|
||||
|
||||
Reference in New Issue
Block a user