feat: add the ability to choose default collection (#3029)
Co-authored-by: Tom Moor <tom@getoutline.com> Co-authored-by: Tom Moor <tom.moor@gmail.com>
This commit is contained in:
@@ -139,7 +139,10 @@ export default class CollectionsStore extends BaseStore<Collection> {
|
||||
}
|
||||
|
||||
@action
|
||||
async fetch(id: string, options: Record<string, any> = {}): Promise<any> {
|
||||
async fetch(
|
||||
id: string,
|
||||
options: Record<string, any> = {}
|
||||
): Promise<Collection> {
|
||||
const item = this.get(id) || this.getByUrl(id);
|
||||
if (item && !options.force) {
|
||||
return item;
|
||||
@@ -164,6 +167,13 @@ export default class CollectionsStore extends BaseStore<Collection> {
|
||||
}
|
||||
}
|
||||
|
||||
@computed
|
||||
get publicCollections() {
|
||||
return this.orderedData.filter((collection) =>
|
||||
["read", "read_write"].includes(collection.permission || "")
|
||||
);
|
||||
}
|
||||
|
||||
getPathForDocument(documentId: string): DocumentPath | undefined {
|
||||
return this.pathsToDocuments.find((path) => path.id === documentId);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user