Fix findLatestPr to prioritize open PRs and remove unused icon imports
- findLatestPr: sort open PRs before merged/closed so the UI correctly detects existing open PRs and avoids offering duplicate 'Create PR' - Sidebar: remove unused MonitorIcon, MoonIcon, SunIcon imports
This commit is contained in:
1 parent
37e17e9207
commit
8578146fb9
2 files changed
+4
-7
No files matched your search
@@ -458,6 +458,9 @@ export class GitManager {
|
||||
}
|
||||
|
||||
const parsed = parsePullRequestList(parsedJson).toSorted((a, b) => {
|
||||
const aOpen = a.state === "open" ? 1 : 0;
|
||||
const bOpen = b.state === "open" ? 1 : 0;
|
||||
if (aOpen !== bOpen) return bOpen - aOpen;
|
||||
const left = a.updatedAt ? Date.parse(a.updatedAt) : 0;
|
||||
const right = b.updatedAt ? Date.parse(b.updatedAt) : 0;
|
||||
return right - left;
|
||||
|
||||
@@ -1,10 +1,4 @@
|
||||
import {
|
||||
GitPullRequestIcon,
|
||||
MonitorIcon,
|
||||
MoonIcon,
|
||||
SunIcon,
|
||||
TerminalIcon,
|
||||
} from "lucide-react";
|
||||
import { GitPullRequestIcon, TerminalIcon } from "lucide-react";
|
||||
import { useCallback, useEffect, useMemo, useState } from "react";
|
||||
import type { ResolvedKeybindingsConfig } from "@t3tools/contracts";
|
||||
import { useMutation, useQueries, useQuery, useQueryClient } from "@tanstack/react-query";
|
||||
|
||||
Reference in new issue
Block a user