mirror of
https://github.com/logseq/logseq.git
synced 2026-05-28 14:39:48 +00:00
chore: remove rage-wasm since we moved to use the native binding (#7446)
This commit is contained in:
@@ -137,7 +137,7 @@
|
||||
;; TODO: ugly, replace with ls-files and filter with ".map"
|
||||
_ (p/all (map (fn [file]
|
||||
(. fs removeSync (path/join static-dir "js" (str file ".map"))))
|
||||
["main.js" "code-editor.js" "excalidraw.js" "age-encryption.js"]))]
|
||||
["main.js" "code-editor.js" "excalidraw.js"]))]
|
||||
|
||||
(send-to-renderer
|
||||
:notification
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
[frontend.util :as util]
|
||||
[promesa.core :as p]
|
||||
[electron.ipc :as ipc]
|
||||
[shadow.loader :as loader]
|
||||
[frontend.mobile.util :as mobile-util]))
|
||||
|
||||
(defn encrypt-with-passphrase
|
||||
@@ -22,10 +21,7 @@
|
||||
:data)
|
||||
|
||||
:else
|
||||
(p/let [lazy-encrypt-with-user-passphrase (resolve 'frontend.extensions.age-encryption/encrypt-with-user-passphrase)
|
||||
content (utf8/encode content)
|
||||
encrypted (@lazy-encrypt-with-user-passphrase passphrase content true)]
|
||||
(utf8/decode encrypted))))
|
||||
nil))
|
||||
|
||||
(defn decrypt-with-passphrase
|
||||
[passphrase content]
|
||||
@@ -42,8 +38,4 @@
|
||||
:data)
|
||||
|
||||
:else
|
||||
(p/let [_ (loader/load :age-encryption)
|
||||
lazy-decrypt-with-user-passphrase (resolve 'frontend.extensions.age-encryption/decrypt-with-user-passphrase)
|
||||
content (utf8/encode content)
|
||||
decrypted (lazy-decrypt-with-user-passphrase passphrase content)]
|
||||
(utf8/decode decrypted))))
|
||||
nil))
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
(ns frontend.extensions.age-encryption
|
||||
(:require ["regenerator-runtime/runtime"] ;; required for async npm module
|
||||
["@kanru/rage-wasm" :as rage]))
|
||||
|
||||
(defn keygen
|
||||
[]
|
||||
(rage/keygen))
|
||||
|
||||
(defn encrypt-with-x25519
|
||||
[public-key content armor]
|
||||
(rage/encrypt_with_x25519 public-key content armor))
|
||||
|
||||
(defn decrypt-with-x25519
|
||||
[secret-key content]
|
||||
(rage/decrypt_with_x25519 secret-key content))
|
||||
|
||||
(defn encrypt-with-user-passphrase
|
||||
[passphrase content armor]
|
||||
(rage/encrypt_with_user_passphrase passphrase content armor))
|
||||
|
||||
(defn decrypt-with-user-passphrase
|
||||
[passphrase content]
|
||||
(rage/decrypt_with_user_passphrase passphrase content))
|
||||
Reference in New Issue
Block a user