mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-16 11:47:54 +01:00
core: fix type errors
This commit is contained in:
@@ -389,9 +389,8 @@ export class Notes implements ICollection {
|
||||
const tags = (await this.db.relations.to(note, "tag").resolve()).map(
|
||||
(tag) => tag.title
|
||||
);
|
||||
const color = (await this.db.relations.to(note, "color").resolve(1)).at(
|
||||
0
|
||||
)?.title;
|
||||
const color = (await this.db.relations.to(note, "color").resolve(1))[0]
|
||||
?.title;
|
||||
|
||||
return options?.disableTemplate
|
||||
? contentString
|
||||
|
||||
@@ -73,8 +73,8 @@ export class Vaults implements ICollection {
|
||||
* This is temporary until we add proper support for multiple vaults
|
||||
* @deprecated
|
||||
*/
|
||||
async default() {
|
||||
return (await this.all.items()).at(0);
|
||||
async default(): Promise<Vault | undefined> {
|
||||
return (await this.all.items())[0];
|
||||
}
|
||||
|
||||
get all() {
|
||||
|
||||
@@ -674,7 +674,10 @@ export default class Backup {
|
||||
}
|
||||
}
|
||||
|
||||
const collectionKey: CollectionName = itemTypeToCollectionKey[itemType];
|
||||
const collectionKey: CollectionName =
|
||||
itemTypeToCollectionKey[
|
||||
itemType as keyof typeof itemTypeToCollectionKey
|
||||
];
|
||||
if (!collectionKey) continue;
|
||||
|
||||
if (itemType === "color") {
|
||||
|
||||
@@ -555,7 +555,8 @@ export type SubscriptionPlanId =
|
||||
| "essential"
|
||||
| "pro"
|
||||
| "believer"
|
||||
| "education";
|
||||
| "education"
|
||||
| "legacyPro";
|
||||
|
||||
export enum SubscriptionPlan {
|
||||
FREE = 0,
|
||||
@@ -678,5 +679,7 @@ export function planToId(plan: SubscriptionPlan): SubscriptionPlanId {
|
||||
return "essential";
|
||||
case SubscriptionPlan.PRO:
|
||||
return "pro";
|
||||
case SubscriptionPlan.LEGACY_PRO:
|
||||
return "legacyPro";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user