mirror of
https://github.com/SableClient/Sable.git
synced 2026-12-05 08:12:22 -08:00
feat(tauri): Addressed review, updated package
This commit is contained in:
1 parent
daeec6035d
commit
ade84faf67
6 files changed
+9
-39
No files matched your search
+1
-1
@@ -94,7 +94,7 @@
|
||||
"slate-history": "^0.113.1",
|
||||
"slate-react": "^0.123.0",
|
||||
"tauri-plugin-splashscreen-api": "file:./crates/tauri-plugin-splashscreen",
|
||||
"@choochmeque/tauri-plugin-notifications-api": "file:./crates/tauri-plugin-notifications",
|
||||
"@sableclient/tauri-plugin-notifications-api": "git+https://github.com/SableClient/tauri-plugin-notifications.git#fc33075e9967b62f0c7f569e9bbcaa7851d6df71",
|
||||
"ua-parser-js": "^1.0.41",
|
||||
"workbox-precaching": "^7.4.0"
|
||||
},
|
||||
|
||||
Generated
+1
@@ -4243,6 +4243,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "tauri-plugin-notifications"
|
||||
version = "0.4.3"
|
||||
source = "git+https://github.com/SableClient/tauri-plugin-notifications.git?rev=fc33075e9967b62f0c7f569e9bbcaa7851d6df71#fc33075e9967b62f0c7f569e9bbcaa7851d6df71"
|
||||
dependencies = [
|
||||
"log",
|
||||
"notify-rust",
|
||||
|
||||
@@ -53,5 +53,5 @@ tauri-plugin-single-instance = { version = "2.4.0", features = ["deep-link"] }
|
||||
tauri-plugin-window-state = "2.4.1"
|
||||
|
||||
[target.'cfg(target_os = "android")'.dependencies]
|
||||
tauri-plugin-notifications = { path = "../crates/tauri-plugin-notifications", features = ["unified-push"] }
|
||||
tauri-plugin-notifications = { git = "https://github.com/SableClient/tauri-plugin-notifications.git", rev = "fc33075e9967b62f0c7f569e9bbcaa7851d6df71", features = ["unified-push"] }
|
||||
|
||||
@@ -12,8 +12,11 @@ import {
|
||||
removeActive,
|
||||
createChannel,
|
||||
Importance,
|
||||
} from '$plugins/tauri-notifications';
|
||||
import type { MessagingStyleMessage, MessagingStylePerson } from '$plugins/tauri-notifications';
|
||||
} from '@sableclient/tauri-plugin-notifications-api';
|
||||
import type {
|
||||
MessagingStyleMessage,
|
||||
MessagingStylePerson,
|
||||
} from '@sableclient/tauri-plugin-notifications-api';
|
||||
import { EventType } from 'matrix-js-sdk/lib/@types/event';
|
||||
import { resolveNotificationPreviewText } from '$utils/notificationStyle';
|
||||
import { getMxIdLocalPart } from '$utils/matrix';
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
// Re-exports from the local tauri-plugin-notifications package (crates/tauri-plugin-notifications/).
|
||||
|
||||
export {
|
||||
sendNotification,
|
||||
removeActive,
|
||||
createChannel,
|
||||
Importance,
|
||||
Visibility,
|
||||
registerForUnifiedPush,
|
||||
unregisterFromUnifiedPush,
|
||||
getUnifiedPushDistributors,
|
||||
saveUnifiedPushDistributor,
|
||||
getUnifiedPushDistributor,
|
||||
onUnifiedPushEndpoint,
|
||||
onUnifiedPushMessage,
|
||||
onUnifiedPushUnregistered,
|
||||
onUnifiedPushError,
|
||||
onUnifiedPushTempUnavailable,
|
||||
} from '@choochmeque/tauri-plugin-notifications-api';
|
||||
|
||||
export type {
|
||||
UnifiedPushEndpoint,
|
||||
UnifiedPushPublicKeySet,
|
||||
Channel,
|
||||
MessagingStylePerson,
|
||||
MessagingStyleMessage,
|
||||
MessagingStyleConfig,
|
||||
} from '@choochmeque/tauri-plugin-notifications-api';
|
||||
@@ -1,12 +1,6 @@
|
||||
import { isTauri } from '@tauri-apps/api/core';
|
||||
|
||||
let swSupported: boolean | undefined;
|
||||
|
||||
export function hasServiceWorker(): boolean {
|
||||
// Android WebViews (Tauri) do not support service workers.
|
||||
// Cache the result to avoid repeated isTauri() IPC overhead.
|
||||
if (swSupported === undefined) {
|
||||
swSupported = 'serviceWorker' in navigator && !isTauri();
|
||||
}
|
||||
return swSupported;
|
||||
return 'serviceWorker' in navigator && !isTauri();
|
||||
}
|
||||
Reference in new issue
Block a user