feat: Start the ability to star/bookmark a project.
- Currently toggles & stores correctly locally on project. Does not show on other screens.
This commit is contained in:
@@ -157,10 +157,8 @@ export async function retrieveSettingsForDefaultAccount(): Promise<Settings> {
|
||||
result.columns,
|
||||
result.values,
|
||||
)[0] as Settings;
|
||||
if (settings.searchBoxes) {
|
||||
// @ts-expect-error - the searchBoxes field is a string in the DB
|
||||
settings.searchBoxes = JSON.parse(settings.searchBoxes);
|
||||
}
|
||||
settings.searchBoxes = parseJsonField(settings.searchBoxes, []);
|
||||
settings.starredProjectIds = parseJsonField(settings.starredProjectIds, []);
|
||||
return settings;
|
||||
}
|
||||
}
|
||||
@@ -226,10 +224,11 @@ export async function retrieveSettingsForActiveAccount(): Promise<Settings> {
|
||||
);
|
||||
}
|
||||
|
||||
// Handle searchBoxes parsing
|
||||
if (settings.searchBoxes) {
|
||||
settings.searchBoxes = parseJsonField(settings.searchBoxes, []);
|
||||
}
|
||||
settings.searchBoxes = parseJsonField(settings.searchBoxes, []);
|
||||
settings.starredProjectIds = parseJsonField(
|
||||
settings.starredProjectIds,
|
||||
[],
|
||||
);
|
||||
|
||||
return settings;
|
||||
} catch (error) {
|
||||
|
||||
@@ -60,6 +60,10 @@ export type Settings = {
|
||||
showContactGivesInline?: boolean; // Display contact inline or not
|
||||
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 IDs, which are recommended to be handleIds
|
||||
starredProjectIds?: Array<string>;
|
||||
|
||||
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
|
||||
@@ -69,6 +73,7 @@ export type Settings = {
|
||||
// type of settings where the searchBoxes are JSON strings instead of objects
|
||||
export type SettingsWithJsonStrings = Settings & {
|
||||
searchBoxes: string;
|
||||
starredProjectIds: string;
|
||||
};
|
||||
|
||||
export function checkIsAnyFeedFilterOn(settings: Settings): boolean {
|
||||
|
||||
Reference in New Issue
Block a user