Skip to content

Commit

Permalink
fix: bug report url on native mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
andelf authored and tiensonqin committed Dec 1, 2022
1 parent 6aeb244 commit 0386cf2
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ body:
- type: textarea
id: problem
attributes:
label: What happened?
label: What Happened?
description: |
Please provide as much info as possible. Not doing so may result in your bug not being addressed in a timely manner.
validations:
Expand Down Expand Up @@ -41,7 +41,7 @@ body:
- type: textarea
id: platform
attributes:
label: Desktop or mobile Platform Information
label: Desktop or Mobile Platform Information
description: |
Would you mind to tell us the system information about your desktop or mobile platform?
placeholder: |
Expand Down
9 changes: 8 additions & 1 deletion capacitor.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { CapacitorConfig } from '@capacitor/cli'
import fs from 'fs'

const version = fs.readFileSync('static/package.json', 'utf8').match(/"version": "(.*?)"/)?.at(1) ?? '0.0.0'

const config: CapacitorConfig = {
appId: 'com.logseq.app',
Expand All @@ -18,8 +21,12 @@ const config: CapacitorConfig = {
resize: 'none'
}
},
android: {
appendUserAgent: `Logseq/${version} (Android)`
},
ios: {
scheme: 'Logseq'
scheme: 'Logseq',
appendUserAgent: `Logseq/${version} (iOS)`
},
cordova: {
staticPlugins: [
Expand Down
10 changes: 7 additions & 3 deletions src/main/frontend/components/header.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
[frontend.util :as util]
[frontend.version :refer [version]]
[reitit.frontend.easy :as rfe]
[rum.core :as rum]))
[rum.core :as rum]
[clojure.string :as string]))

(rum/defc home-button
< {:key-fn #(identity "home-button")}
Expand Down Expand Up @@ -59,8 +60,11 @@
(ui/icon "menu-2" {:size ui/icon-size})]))

(def bug-report-url
(let [platform (str "App Version: " version "\n"
"Platform: " (.-userAgent js/navigator) "\n"
(let [ua (.-userAgent js/navigator)
safe-ua (string/replace ua #"[^_/a-zA-Z0-9\.\(\)]+" " ")
platform (str "App Version: " version "\n"
"Git Revision: " config/REVISION "\n"
"Platform: " safe-ua "\n"
"Language: " (.-language js/navigator))]
(str "https://github.com/logseq/logseq/issues/new?"
"title=&"
Expand Down

0 comments on commit 0386cf2

Please sign in to comment.