mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-16 11:47:54 +01:00
web: fix web app on Safari
This commit is contained in:
2116
apps/web/package-lock.json
generated
2116
apps/web/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
2
apps/web/src/global.d.ts
vendored
2
apps/web/src/global.d.ts
vendored
@@ -71,7 +71,7 @@ declare global {
|
||||
}
|
||||
interface Window {
|
||||
ApplePaySession?: {
|
||||
canMakePayments(): boolean;
|
||||
canMakePayments(): boolean | Promise<boolean>;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,9 +22,18 @@ const FEATURE_CHECKS = {
|
||||
cache: false,
|
||||
indexedDB: false,
|
||||
clonableCryptoKey: false,
|
||||
applePaySupported: !!window.ApplePaySession?.canMakePayments()
|
||||
applePaySupported: false
|
||||
};
|
||||
|
||||
async function isApplePaySupported() {
|
||||
try {
|
||||
FEATURE_CHECKS.applePaySupported =
|
||||
!!(await window.ApplePaySession?.canMakePayments());
|
||||
} catch {
|
||||
FEATURE_CHECKS.applePaySupported = false;
|
||||
}
|
||||
}
|
||||
|
||||
async function isOPFSSupported() {
|
||||
const hasGetDirectory =
|
||||
"getDirectory" in window.navigator.storage &&
|
||||
@@ -93,7 +102,8 @@ export async function initializeFeatureChecks() {
|
||||
isOPFSSupported(),
|
||||
isCacheSupported(),
|
||||
isIndexedDBSupported(),
|
||||
isCryptoKeyClonable()
|
||||
isCryptoKeyClonable(),
|
||||
isApplePaySupported()
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user