From b390ce4590521cb928b87a107f73b0c99fd004ea Mon Sep 17 00:00:00 2001 From: GalvinGao Date: Tue, 22 Dec 2020 04:51:08 +0800 Subject: [PATCH 01/20] fix(haptics): fix haptics error --- src/utils/native/haptics.js | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/src/utils/native/haptics.js b/src/utils/native/haptics.js index 064ded8d..385edcaf 100644 --- a/src/utils/native/haptics.js +++ b/src/utils/native/haptics.js @@ -2,40 +2,49 @@ import { Plugins, HapticsImpactStyle, HapticsNotificationType } from '@capacitor/core'; +import Console from "@/utils/Console"; const { Haptics } = Plugins; window.GlobalCapacitorHaptics = Haptics +function invoke(method, ...args) { + try { + Haptics.prototype.call(method, args) + } catch (e) { + Console.warn('Haptics', 'failed to invoke haptics', e) + } +} + export default { light() { - Haptics.impact({ + invoke('impact', { style: HapticsImpactStyle.Heavy - }); + }) }, error() { - Haptics.notification({ - type: HapticsNotificationType.ERROR + invoke('notification', { + style: HapticsNotificationType.ERROR }) }, warning() { - Haptics.notification({ - type: HapticsNotificationType.WARNING + invoke('notification', { + style: HapticsNotificationType.WARNING }) }, success() { - Haptics.notification({ - type: HapticsNotificationType.SUCCESS + invoke('notification', { + style: HapticsNotificationType.SUCCESS }) }, notification(type) { - Haptics.notification({type}) + invoke('notification', type) }, impact(style) { - Haptics.impact({style}) + invoke('impact', style) } } \ No newline at end of file From 42dce6d28a0373f843cd78461722453211376fc9 Mon Sep 17 00:00:00 2001 From: GalvinGao Date: Tue, 22 Dec 2020 05:05:39 +0800 Subject: [PATCH 02/20] fix(multiple): fix various bugs --- src/components/global/MirrorSelector.vue | 2 +- src/components/global/PWAPopups.vue | 2 +- src/styles/global.css | 2 +- src/utils/native/haptics.js | 3 ++- src/utils/snackbar.js | 2 +- src/views/Report.vue | 2 +- 6 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/components/global/MirrorSelector.vue b/src/components/global/MirrorSelector.vue index 545741ef..4db52c8f 100644 --- a/src/components/global/MirrorSelector.vue +++ b/src/components/global/MirrorSelector.vue @@ -48,7 +48,7 @@ v-if="enabled && mirror" v-model="enabled" :color="`stripped--${dark ? 'dark' : 'light'}`" - :timeout="-1" + :timeout="0" top > Console.warn('Haptics', 'failed to invoke haptics', e)) } catch (e) { Console.warn('Haptics', 'failed to invoke haptics', e) } diff --git a/src/utils/snackbar.js b/src/utils/snackbar.js index b8bc8e4a..7ceae99c 100644 --- a/src/utils/snackbar.js +++ b/src/utils/snackbar.js @@ -14,7 +14,7 @@ export default { if (type === "error") haptics.error() if (type === "success") haptics.success() - return store.commit("ui/setSnackbar", { + store.commit("ui/setSnackbar", { color: type, timeout, text, diff --git a/src/views/Report.vue b/src/views/Report.vue index d70e7480..ac7481d6 100644 --- a/src/views/Report.vue +++ b/src/views/Report.vue @@ -6,7 +6,7 @@ Date: Tue, 22 Dec 2020 05:06:49 +0800 Subject: [PATCH 03/20] improvement(changelog): add changelog --- src/views/About/Changelog.vue | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/views/About/Changelog.vue b/src/views/About/Changelog.vue index 382e5f38..68d0544b 100644 --- a/src/views/About/Changelog.vue +++ b/src/views/About/Changelog.vue @@ -201,6 +201,10 @@ export default { ## 重构 1. 重新设计了「团队成员」页面 +--- +## 热修复记录 +1. 修复了掉落汇报页面可能导致汇报成功提示无法弹出的问题 +2. 修复了部分组件可能浮动于 App Bar 上方的问题 ` }, { From 1101d6c678b34af7adddd2afc7447c9f65ccb163 Mon Sep 17 00:00:00 2001 From: GalvinGao Date: Wed, 23 Dec 2020 02:01:54 +0800 Subject: [PATCH 04/20] improvement(search): improved search engine --- ios/App/App/config.xml | 4 +- ios/App/PenguinWidget/PenguinWidget.swift | 6 +- package.json | 2 + src/components/search/GlobalSearch.vue | 87 +++++------------- src/utils/searchEngine.js | 75 ++++++---------- src/views/About/Changelog.vue | 1 - src/views/Search.vue | 3 +- yarn.lock | 102 +++++++++++++++++++--- 8 files changed, 148 insertions(+), 132 deletions(-) diff --git a/ios/App/App/config.xml b/ios/App/App/config.xml index 1b1b0e0d..29142147 100644 --- a/ios/App/App/config.xml +++ b/ios/App/App/config.xml @@ -1,6 +1,4 @@ - - - \ No newline at end of file + diff --git a/ios/App/PenguinWidget/PenguinWidget.swift b/ios/App/PenguinWidget/PenguinWidget.swift index 71762ce8..a7fa0705 100644 --- a/ios/App/PenguinWidget/PenguinWidget.swift +++ b/ios/App/PenguinWidget/PenguinWidget.swift @@ -55,7 +55,11 @@ struct PenguinWidget: Widget { let kind: String = "PenguinWidget" var body: some WidgetConfiguration { - IntentConfiguration(kind: kind, intent: ConfigurationIntent.self, provider: Provider()) { entry in + IntentConfiguration( + kind: kind, + intent: ConfigurationIntent.self, + provider: Provider() + ) { entry in PenguinWidgetEntryView(entry: entry) } .configurationDisplayName("My Widget") diff --git a/package.json b/package.json index 6dd6f68e..a4aebe37 100644 --- a/package.json +++ b/package.json @@ -37,11 +37,13 @@ "core-js": "^3.6.5", "dayjs": "1.8.27", "extract-domain": "^2.2.1", + "fuse.js": "^6.4.3", "highcharts": "^8.1.0", "highcharts-vue": "^1.3.5", "intl-collator": "^0.1.6", "js-cookie": "^2.2.1", "katex": "^0.12.0", + "lodash": "^4.17.20", "marked": "^1.0.0", "minisearch": "^3.0.2", "qs": "^6.9.4", diff --git a/src/components/search/GlobalSearch.vue b/src/components/search/GlobalSearch.vue index a7323d6e..e625ec20 100644 --- a/src/components/search/GlobalSearch.vue +++ b/src/components/search/GlobalSearch.vue @@ -59,71 +59,12 @@ /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -