Skip to content

Commit

Permalink
fix(ios): empty repo-url on first-boot(logged) (#149)
Browse files Browse the repository at this point in the history
Co-authored-by: Andelf <[email protected]>
Co-authored-by: gfgafn <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: charlie <[email protected]>
  • Loading branch information
5 people authored Jul 12, 2023
1 parent 20c8887 commit 4c841b3
Show file tree
Hide file tree
Showing 13 changed files with 75 additions and 55 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/stale-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
stale-issue-label: ':status/automatic-stale'
close-issue-label: ':status/automatic-closing'
# trunk-ignore(yamllint/line-length)
exempt-issue-labels: ':status/hold, :status/WIP, :type/enhancement, type/can-be-reproduced, priority-A'
exempt-issue-labels: 'hold, WIP, :type/enhancement, can-be-reproduced, priority-A, :type/bug, :type/feature-request'
remove-stale-when-updated: true
stale-issue-message: |
Hi There! 👋
Expand Down
12 changes: 6 additions & 6 deletions libs/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2229,14 +2229,14 @@ schema-utils@^4.0.0:
ajv-keywords "^5.0.0"

semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.3.0:
version "6.3.0"
resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d"
integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==
version "6.3.1"
resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4"
integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==

semver@^7.3.4:
version "7.3.5"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7"
integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==
version "7.5.4"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e"
integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==
dependencies:
lru-cache "^6.0.0"

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
"d3-force": "3.0.0",
"diff": "5.0.0",
"dompurify": "2.4.0",
"electron": "25.2.0",
"electron": "24.6.2",
"electron-dl": "3.3.0",
"fs": "0.0.1-security",
"fs-extra": "9.1.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/amplify/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5087,9 +5087,9 @@ scheduler@^0.20.2:
object-assign "^4.1.1"

semver@^5.7.0, semver@^5.7.1:
version "5.7.1"
resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7"
integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==
version "5.7.2"
resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.2.tgz#48d55db737c3287cd4835e17fa13feace1c41ef8"
integrity sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==

sentence-case@^3.0.4:
version "3.0.4"
Expand Down
6 changes: 3 additions & 3 deletions resources/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"electron:make": "electron-forge make",
"electron:make-macos-arm64": "electron-forge make --platform=darwin --arch=arm64",
"electron:publish:github": "electron-forge publish",
"rebuild:all": "electron-rebuild -v 25.2.0 -f",
"rebuild:all": "electron-rebuild -v 24.6.2 -f",
"postinstall": "install-app-deps"
},
"config": {
Expand Down Expand Up @@ -52,12 +52,12 @@
"@electron-forge/maker-squirrel": "^6.0.4",
"@electron-forge/maker-zip": "^6.0.4",
"@electron/rebuild": "3.2.10",
"electron": "25.2.0",
"electron": "24.6.2",
"electron-builder": "^22.11.7",
"electron-forge-maker-appimage": "https://github.com/logseq/electron-forge-maker-appimage.git"
},
"resolutions": {
"**/electron": "25.2.0",
"**/electron": "24.6.2",
"**/node-gyp": "9.0.0"
}
}
2 changes: 1 addition & 1 deletion src/main/frontend/fs/diff_merge.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
income-diffblocks (ast->diff-blocks-alt income-ast income format options)
current-ast (->ast current)
current-diffblocks (ast->diff-blocks-alt current-ast current format options)
branch-diffblocks [income-diffblocks current-diffblocks]
branch-diffblocks [current-diffblocks income-diffblocks]
merged (.mergeBlocks merger (bean/->js base-diffblocks) (bean/->js branch-diffblocks))
;; For extracting diff-merge test cases
;; _ (prn "input:")
Expand Down
3 changes: 2 additions & 1 deletion src/main/frontend/handler/editor.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -2698,7 +2698,8 @@
(delete-concat current-block)))

:else
(delete-and-update input current-pos (inc current-pos))))))
(delete-and-update
input current-pos (util/safe-inc-current-pos-from-start (.-value input) current-pos))))))

(defn keydown-backspace-handler
[cut? e]
Expand Down
8 changes: 5 additions & 3 deletions src/main/frontend/handler/plugin.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@
(when-let [hook (and uuid (str "hook:db:block_" (string/replace (str uuid) "-" "_")))]
(boolean (seq (get (get-installed-hooks) hook)))))

(def *fenced-code-providers (atom #{}))
(defonce *fenced-code-providers (atom #{}))

(defn register-fenced-code-renderer
[pid type {:keys [before subs render edit] :as _opts}]
Expand All @@ -389,8 +389,10 @@
(defn hook-fenced-code-by-type
[type]
(when-let [key (and (seq @*fenced-code-providers) type (keyword type))]
(first (map #(state/get-plugin-resource % :fenced-code-renderers key)
@*fenced-code-providers))))
(->> @*fenced-code-providers
(map #(state/get-plugin-resource % :fenced-code-renderers key))
(remove nil?)
(first))))

(def *extensions-enhancer-providers (atom #{}))

Expand Down
23 changes: 13 additions & 10 deletions src/main/frontend/util/text.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -142,14 +142,17 @@
[value nil nil])))

(defn get-graph-name-from-path
"Get `Dir/GraphName` style name for from repo-url"
"Get `Dir/GraphName` style name for from repo-url.
On iOS, repo-url might be nil"
[repo-url]
(let [path (config/get-local-dir repo-url)
path (if (path/is-file-url? path)
(path/url-to-path path)
path)
parts (->> (string/split path #"/")
(take-last 2))]
(if (not= (first parts) "0")
(util/string-join-path parts)
(last parts))))
(when (not-empty repo-url)
(let [path (config/get-local-dir repo-url)
path (if (path/is-file-url? path)
(path/url-to-path path)
path)
parts (->> (string/split path #"/")
(take-last 2))]
(if (not= (first parts) "0")
(util/string-join-path parts)
(last parts)))))
20 changes: 17 additions & 3 deletions src/test/frontend/fs/diff_merge_test.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
:uuid "63e25526-3612-4fb1-8cf9-f66db1254a58" :level 1}
{:body "b" :uuid nil :level 2}
{:body "c" :uuid nil :level 3}]

"alias:: ⭐️\nicon:: ⭐️"
[{:body "alias:: ⭐️\nicon:: ⭐️", :level 1, :uuid nil}]))

Expand Down Expand Up @@ -191,7 +191,7 @@
:uuid "63e25526-3612-4fb1-8cf9-f66db1254a58" :level 1 :meta {:raw-body "- a\n id:: 63e25526-3612-4fb1-8cf9-f66db1254a58"}}
{:body "b" :uuid nil :level 2 :meta {:raw-body "\t- b"}}
{:body "c" :uuid nil :level 3 :meta {:raw-body "\t\t- c"}}]

"alias:: ⭐️\nicon:: ⭐️"
[{:body "alias:: ⭐️\nicon:: ⭐️", :meta {:raw-body "alias:: ⭐️\nicon:: ⭐️"}, :level 1, :uuid nil}]))

Expand Down Expand Up @@ -470,4 +470,18 @@
"- a\n id:: 648ab5e6-5e03-4c61-95d4-dd904a0a007f\n aaa:: 111\n- b"
"- c"
:markdown)
"- a\n id:: 648ab5e6-5e03-4c61-95d4-dd904a0a007f\n aaa:: 111\n- c")))
"- a\n id:: 648ab5e6-5e03-4c61-95d4-dd904a0a007f\n aaa:: 111\n- c"))

(is (= (fs-diff/three-way-merge
"- a\n- b\n- c"
"- a\n- b\n- c\n- d"
"- a\n\t- b\n- c"
:markdown)
"- a\n\t- b\n- c\n- d"))

(is (= (fs-diff/three-way-merge
"- a\n- b\n- c"
"- a\n\t- b\n- c"
"- a\n- b\n- c\n- d"
:markdown)
"- a\n- b\n- c\n- d")))
8 changes: 4 additions & 4 deletions static/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2086,10 +2086,10 @@ electron-winstaller@^5.0.0:
lodash.template "^4.2.2"
temp "^0.9.0"

electron@*, electron@25.2.0:
version "25.2.0"
resolved "https://registry.yarnpkg.com/electron/-/electron-25.2.0.tgz#ff832d88f78481a82cf9feb72e605ec43553d4ba"
integrity sha512-I/rhcW2sV2fyiveVSBr2N7v5ZiCtdGY0UiNCDZgk2fpSC+irQjbeh7JT2b4vWmJ2ogOXBjqesrN9XszTIG6DHg==
electron@*, electron@24.6.2:
version "24.6.2"
resolved "https://registry.yarnpkg.com/electron/-/electron-24.6.2.tgz#c7958fd05efcb6d4f9854862f8c6146791d1fdc2"
integrity sha512-HC0lE1u9GYfj82Tt60Y/T+ELTdBKlvfPwLCzB6mWsyqYvrb2mtBy5fBSNtlfT0MWZOMh6J2of/AEYaLitniNCQ==
dependencies:
"@electron/get" "^2.0.0"
"@types/node" "^18.11.18"
Expand Down
12 changes: 6 additions & 6 deletions tldraw/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4285,14 +4285,14 @@ scheduler@^0.20.2:
object-assign "^4.1.1"

semver@^6.3.0:
version "6.3.0"
resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d"
integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==
version "6.3.1"
resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4"
integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==

semver@^7.3.7:
version "7.3.7"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.7.tgz#12c5b649afdbf9049707796e22a4028814ce523f"
integrity sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==
version "7.5.4"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e"
integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==
dependencies:
lru-cache "^6.0.0"

Expand Down
26 changes: 13 additions & 13 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2570,10 +2570,10 @@ electron-to-chromium@^1.4.251:
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.284.tgz#61046d1e4cab3a25238f6bf7413795270f125592"
integrity sha512-M8WEXFuKXMYMVr45fo8mq0wUrrJHheiKZf6BArTKk9ZBYCKJEOU5H8cdWgDT+qCVZf7Na4lVUaZsA+h6uA9+PA==

electron@25.2.0:
version "25.2.0"
resolved "https://registry.yarnpkg.com/electron/-/electron-25.2.0.tgz#ff832d88f78481a82cf9feb72e605ec43553d4ba"
integrity sha512-I/rhcW2sV2fyiveVSBr2N7v5ZiCtdGY0UiNCDZgk2fpSC+irQjbeh7JT2b4vWmJ2ogOXBjqesrN9XszTIG6DHg==
electron@24.6.2:
version "24.6.2"
resolved "https://registry.yarnpkg.com/electron/-/electron-24.6.2.tgz#c7958fd05efcb6d4f9854862f8c6146791d1fdc2"
integrity sha512-HC0lE1u9GYfj82Tt60Y/T+ELTdBKlvfPwLCzB6mWsyqYvrb2mtBy5fBSNtlfT0MWZOMh6J2of/AEYaLitniNCQ==
dependencies:
"@electron/get" "^2.0.0"
"@types/node" "^18.11.18"
Expand Down Expand Up @@ -6500,19 +6500,19 @@ semver-greatest-satisfied-range@^1.1.0:
sver-compat "^1.5.0"

"semver@2 || 3 || 4 || 5", semver@^5.5.0:
version "5.7.1"
resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7"
integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==
version "5.7.2"
resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.2.tgz#48d55db737c3287cd4835e17fa13feace1c41ef8"
integrity sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==

semver@^6.2.0, semver@^6.3.0:
version "6.3.0"
resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d"
integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==
version "6.3.1"
resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4"
integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==

semver@^7.3.2, semver@^7.3.4, semver@^7.3.7:
version "7.3.7"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.7.tgz#12c5b649afdbf9049707796e22a4028814ce523f"
integrity sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==
version "7.5.4"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e"
integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==
dependencies:
lru-cache "^6.0.0"

Expand Down

0 comments on commit 4c841b3

Please sign in to comment.