feat: add starred project list in search, refactor variable names

This commit is contained in:
2025-09-26 20:13:18 -06:00
parent 855448d07a
commit a51fd90659
11 changed files with 140 additions and 143 deletions

View File

@@ -158,7 +158,10 @@ export async function retrieveSettingsForDefaultAccount(): Promise<Settings> {
result.values,
)[0] as Settings;
settings.searchBoxes = parseJsonField(settings.searchBoxes, []);
settings.starredProjectIds = parseJsonField(settings.starredProjectIds, []);
settings.starredPlanHandleIds = parseJsonField(
settings.starredPlanHandleIds,
[],
);
return settings;
}
}
@@ -225,8 +228,8 @@ export async function retrieveSettingsForActiveAccount(): Promise<Settings> {
}
settings.searchBoxes = parseJsonField(settings.searchBoxes, []);
settings.starredProjectIds = parseJsonField(
settings.starredProjectIds,
settings.starredPlanHandleIds = parseJsonField(
settings.starredPlanHandleIds,
[],
);

View File

@@ -36,7 +36,7 @@ export type Settings = {
lastAckedOfferToUserJwtId?: string; // the last JWT ID for offer-to-user that they've acknowledged seeing
lastAckedOfferToUserProjectsJwtId?: string; // the last JWT ID for offers-to-user's-projects that they've acknowledged seeing
lastAckedStarredProjectChangesJwtId?: string; // the last JWT ID for starred project changes that they've acknowledged seeing
lastAckedStarredPlanChangesJwtId?: string; // the last JWT ID for starred plan changes that they've acknowledged seeing
// The claim list has a most recent one used in notifications that's separate from the last viewed
lastNotifiedClaimId?: string;
@@ -62,19 +62,17 @@ export type Settings = {
showGeneralAdvanced?: boolean; // Show advanced features which don't have their own flag
showShortcutBvc?: boolean; // Show shortcut for Bountiful Voluntaryist Community actions
// List of starred project handleIds
starredProjectIds?: Array<string>;
starredPlanHandleIds?: string[]; // Array of starred plan handle IDs
vapid?: string; // VAPID (Voluntary Application Server Identification) field for web push
warnIfProdServer?: boolean; // Warn if using a production server
warnIfTestServer?: boolean; // Warn if using a testing server
webPushServer?: string; // Web Push server URL
};
// type of settings where the searchBoxes are JSON strings instead of objects
// type of settings where the values are JSON strings instead of objects
export type SettingsWithJsonStrings = Settings & {
searchBoxes: string;
starredProjectIds: string;
starredPlanHandleIds: string;
};
export function checkIsAnyFeedFilterOn(settings: Settings): boolean {
@@ -91,6 +89,11 @@ export const SettingsSchema = {
/**
* Constants.
*/
/**
* This is deprecated.
* It only remains for those with a PWA who have not migrated, but we'll soon remove it.
*/
export const MASTER_SETTINGS_KEY = "1";
export const DEFAULT_PASSKEY_EXPIRATION_MINUTES = 15;