mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 12:24:30 +01:00
fix(frontend): order linked server projects by last activity and keep cached lists on refetch errors
This commit is contained in:
1 parent
578a2211ba
commit
36d35cc974
5 files changed
+185
-22
No files matched your search
@@ -37,6 +37,14 @@ export type OpenCodeLocationInfo = Awaited<ReturnType<OpenCodeApi['location']['g
|
||||
|
||||
export type OpenCodeProject = Awaited<ReturnType<OpenCodeApi['project']['list']>>[number]
|
||||
|
||||
/**
|
||||
* The timestamp a project list sorts and labels on: the server's last-activity time, falling back
|
||||
* to the record's update time for a project that has never recorded activity.
|
||||
*/
|
||||
export function projectActivityTimestamp(project: OpenCodeProject): number {
|
||||
return project.time.active || project.time.updated
|
||||
}
|
||||
|
||||
export type VcsInfo = Awaited<ReturnType<OpenCodeApi['vcs']['get']>>['data']
|
||||
|
||||
export type VcsFileStatus = Awaited<ReturnType<OpenCodeApi['vcs']['status']>>['data'][number]
|
||||
|
||||
Reference in new issue
Block a user