diff options
Diffstat (limited to 'packages/shared/src/stores/Profile.ts')
-rw-r--r-- | packages/shared/src/stores/Profile.ts | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/packages/shared/src/stores/Profile.ts b/packages/shared/src/stores/Profile.ts index 076c639..7d00925 100644 --- a/packages/shared/src/stores/Profile.ts +++ b/packages/shared/src/stores/Profile.ts | |||
@@ -18,28 +18,15 @@ | |||
18 | * SPDX-License-Identifier: AGPL-3.0-only | 18 | * SPDX-License-Identifier: AGPL-3.0-only |
19 | */ | 19 | */ |
20 | 20 | ||
21 | import { Instance, types } from 'mobx-state-tree'; | 21 | import { type Instance, types } from 'mobx-state-tree'; |
22 | 22 | ||
23 | import Certificate, { CertificateSnapshotIn } from './Certificate.js'; | ||
24 | import ProfileSettings from './ProfileSettings.js'; | 23 | import ProfileSettings from './ProfileSettings.js'; |
25 | 24 | ||
26 | const Profile = /* @__PURE__ */ (() => | 25 | const Profile = /* @__PURE__ */ (() => |
27 | types | 26 | types.model('Profile', { |
28 | .model('Profile', { | 27 | id: types.identifier, |
29 | id: types.identifier, | 28 | settings: ProfileSettings, |
30 | settings: ProfileSettings, | 29 | }))(); |
31 | temporarilyTrustedCertificates: types.array(Certificate), | ||
32 | }) | ||
33 | .views((self) => ({ | ||
34 | isCertificateTemporarilyTrusted( | ||
35 | certificate: CertificateSnapshotIn, | ||
36 | ): boolean { | ||
37 | return self.temporarilyTrustedCertificates.some( | ||
38 | (trustedCertificate) => | ||
39 | trustedCertificate.fingerprint === certificate.fingerprint, | ||
40 | ); | ||
41 | }, | ||
42 | })))(); | ||
43 | 30 | ||
44 | /* | 31 | /* |
45 | eslint-disable-next-line @typescript-eslint/no-redeclare -- | 32 | eslint-disable-next-line @typescript-eslint/no-redeclare -- |