Files
outline/app/models/Star.ts
Tom Moor 84d6bf8ddf feat: Add ability to star collection (#3327)
* Migrations, models, commands

* ui

* Move starred hint to location state

* lint

* tsc

* refactor

* Add collection empty state in expanded sidebar

* Add empty placeholder within starred collections

* Drag and drop improves, Relative refactor

* fix: Starring untitled draft leaves empty space

* fix: Creating draft in starred collection shouldnt open main

* fix: Dupe drop cursor

* Final fixes

* fix: Canonical redirect replaces starred location state

* fix: Don't show reorder cursor at the top of collection with no permission to edit when dragging
2022-04-03 18:51:01 -07:00

31 lines
590 B
TypeScript

import { observable } from "mobx";
import BaseModel from "./BaseModel";
import Field from "./decorators/Field";
class Star extends BaseModel {
id: string;
@Field
@observable
index: string;
documentId: string;
collectionId: string;
createdAt: string;
updatedAt: string;
next(): Star | undefined {
const index = this.store.orderedData.indexOf(this);
return this.store.orderedData[index + 1];
}
previous(): Star | undefined {
const index = this.store.orderedData.indexOf(this);
return this.store.orderedData[index + 1];
}
}
export default Star;