gitxelectron 1.2.0 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/out/main/index.js
CHANGED
|
@@ -728,6 +728,19 @@ async function unstageFiles(sessionId, files) {
|
|
|
728
728
|
}
|
|
729
729
|
async function commitChanges(sessionId, message) {
|
|
730
730
|
const { git } = getGitSession(sessionId);
|
|
731
|
+
try {
|
|
732
|
+
const nameConfig = await git.getConfig("user.name");
|
|
733
|
+
const emailConfig = await git.getConfig("user.email");
|
|
734
|
+
if (!nameConfig.value || !emailConfig.value) {
|
|
735
|
+
const account = getActiveAccount(sessionId);
|
|
736
|
+
const name = account?.username || "GitQuickPush User";
|
|
737
|
+
const email = account ? `${account.username}@users.noreply.github.com` : "noreply@gitquickpush.local";
|
|
738
|
+
if (!nameConfig.value) await git.addConfig("user.name", name);
|
|
739
|
+
if (!emailConfig.value) await git.addConfig("user.email", email);
|
|
740
|
+
}
|
|
741
|
+
} catch (e) {
|
|
742
|
+
console.warn("Failed to check or set git author identity", e);
|
|
743
|
+
}
|
|
731
744
|
return await git.commit(message);
|
|
732
745
|
}
|
|
733
746
|
function injectAuthToken(sessionId, remoteUrl) {
|
|
@@ -825,12 +838,14 @@ async function getBranches(sessionId) {
|
|
|
825
838
|
GIT_TERMINAL_PROMPT: "0",
|
|
826
839
|
GIT_ASKPASS: "echo"
|
|
827
840
|
});
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
841
|
+
const FETCH_TIMEOUT_MS = 15e3;
|
|
842
|
+
const fetchPromise = remoteObj.refs.fetch ? tempGit.fetch(injectAuthToken(sessionId, remoteObj.refs.fetch), { "--prune": null }) : tempGit.fetch(remoteObj.name, { "--prune": null });
|
|
843
|
+
await Promise.race([
|
|
844
|
+
fetchPromise,
|
|
845
|
+
new Promise(
|
|
846
|
+
(_, reject) => setTimeout(() => reject(new Error("Fetch timed out")), FETCH_TIMEOUT_MS)
|
|
847
|
+
)
|
|
848
|
+
]);
|
|
834
849
|
}
|
|
835
850
|
} catch (e) {
|
|
836
851
|
}
|
|
@@ -12644,12 +12644,12 @@ function RepositoryWizard({ repoPath, onClose, onSuccess }) {
|
|
|
12644
12644
|
localStorage.setItem(`gitquickpush-wizard-dismissed-${repoPath}`, "true");
|
|
12645
12645
|
if (onClose) onClose();
|
|
12646
12646
|
};
|
|
12647
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "absolute inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center z-[70] p-6 transition-opacity", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-surface/95 backdrop-blur-xl rounded-xl shadow-2xl border border-border w-full max-w-[550px] mx-
|
|
12647
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "absolute inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center z-[70] p-4 sm:p-6 transition-opacity", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-surface/95 backdrop-blur-xl rounded-xl shadow-2xl border border-border w-full max-w-[550px] mx-auto overflow-hidden animate-float relative flex flex-col max-h-[90vh]", children: [
|
|
12648
12648
|
isLoading && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "absolute inset-0 bg-surface/90 backdrop-blur-md z-10 flex flex-col items-center justify-center", children: [
|
|
12649
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-[350px]", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Loader, {}) }),
|
|
12649
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-[250px] sm:w-[350px]", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Loader, {}) }),
|
|
12650
12650
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-4 font-mono text-sm text-primary animate-pulse", children: "Processing..." })
|
|
12651
12651
|
] }),
|
|
12652
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between px-6 py-4 border-b border-border bg-surface-hover/50", children: [
|
|
12652
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between px-6 py-4 border-b border-border bg-surface-hover/50 shrink-0", children: [
|
|
12653
12653
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("h2", { className: "text-lg font-bold text-primary flex items-center gap-2", children: [
|
|
12654
12654
|
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-brand", children: "✦" }),
|
|
12655
12655
|
" Repository Setup"
|
|
@@ -12658,7 +12658,7 @@ function RepositoryWizard({ repoPath, onClose, onSuccess }) {
|
|
|
12658
12658
|
"button",
|
|
12659
12659
|
{
|
|
12660
12660
|
onClick: handleClose,
|
|
12661
|
-
className: "text-secondary hover:text-primary transition-colors",
|
|
12661
|
+
className: "text-secondary hover:text-primary transition-colors p-1 rounded-md hover:bg-surface",
|
|
12662
12662
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
12663
12663
|
"path",
|
|
12664
12664
|
{
|
|
@@ -12671,16 +12671,16 @@ function RepositoryWizard({ repoPath, onClose, onSuccess }) {
|
|
|
12671
12671
|
}
|
|
12672
12672
|
)
|
|
12673
12673
|
] }),
|
|
12674
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "p-6", children: [
|
|
12674
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "p-6 overflow-y-auto", children: [
|
|
12675
12675
|
error && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "bg-danger/10 border border-danger/20 text-danger p-3 rounded-md mb-4 text-sm", children: error }),
|
|
12676
|
-
step === 1 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-center", children: [
|
|
12676
|
+
step === 1 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-center py-4", children: [
|
|
12677
12677
|
/* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-lg font-semibold text-primary mb-2", children: "Connecting to GitHub..." }),
|
|
12678
12678
|
deviceFlowData && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4", children: [
|
|
12679
12679
|
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-secondary", children: "Please check your browser to authorize GitQuickPush." }),
|
|
12680
12680
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-sm text-secondary", children: [
|
|
12681
12681
|
"Your code is:",
|
|
12682
12682
|
" ",
|
|
12683
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-mono text-accent font-bold", children: deviceFlowData.user_code })
|
|
12683
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-mono text-accent font-bold bg-surface px-2 py-1 rounded", children: deviceFlowData.user_code })
|
|
12684
12684
|
] }),
|
|
12685
12685
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-center gap-2 text-sm text-primary mt-4", children: [
|
|
12686
12686
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
@@ -12718,7 +12718,7 @@ function RepositoryWizard({ repoPath, onClose, onSuccess }) {
|
|
|
12718
12718
|
] }),
|
|
12719
12719
|
step === 2 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-6", children: [
|
|
12720
12720
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-3", children: [
|
|
12721
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: "flex items-center gap-3 p-3 border border-border rounded-lg cursor-pointer hover:bg-surface-hover transition-colors", children: [
|
|
12721
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: "flex items-start sm:items-center gap-3 p-3 border border-border rounded-lg cursor-pointer hover:bg-surface-hover transition-colors", children: [
|
|
12722
12722
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
12723
12723
|
"input",
|
|
12724
12724
|
{
|
|
@@ -12726,15 +12726,15 @@ function RepositoryWizard({ repoPath, onClose, onSuccess }) {
|
|
|
12726
12726
|
name: "action",
|
|
12727
12727
|
checked: action === "new",
|
|
12728
12728
|
onChange: () => setAction("new"),
|
|
12729
|
-
className: "text-brand focus:ring-brand accent-brand"
|
|
12729
|
+
className: "text-brand focus:ring-brand accent-brand mt-1 sm:mt-0"
|
|
12730
12730
|
}
|
|
12731
12731
|
),
|
|
12732
12732
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
12733
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-primary font-semibold", children: "Create New GitHub Repository" }),
|
|
12733
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-primary font-semibold text-sm sm:text-base", children: "Create New GitHub Repository" }),
|
|
12734
12734
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-secondary text-xs", children: "Create a new remote repository and push this folder." })
|
|
12735
12735
|
] })
|
|
12736
12736
|
] }),
|
|
12737
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: "flex items-center gap-3 p-3 border border-border rounded-lg cursor-pointer hover:bg-surface-hover transition-colors", children: [
|
|
12737
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: "flex items-start sm:items-center gap-3 p-3 border border-border rounded-lg cursor-pointer hover:bg-surface-hover transition-colors", children: [
|
|
12738
12738
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
12739
12739
|
"input",
|
|
12740
12740
|
{
|
|
@@ -12742,15 +12742,15 @@ function RepositoryWizard({ repoPath, onClose, onSuccess }) {
|
|
|
12742
12742
|
name: "action",
|
|
12743
12743
|
checked: action === "existing",
|
|
12744
12744
|
onChange: () => setAction("existing"),
|
|
12745
|
-
className: "text-brand focus:ring-brand accent-brand"
|
|
12745
|
+
className: "text-brand focus:ring-brand accent-brand mt-1 sm:mt-0"
|
|
12746
12746
|
}
|
|
12747
12747
|
),
|
|
12748
12748
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
12749
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-primary font-semibold", children: "Connect to Existing GitHub Repository" }),
|
|
12749
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-primary font-semibold text-sm sm:text-base", children: "Connect to Existing GitHub Repository" }),
|
|
12750
12750
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-secondary text-xs", children: "Link this folder to an existing remote repository." })
|
|
12751
12751
|
] })
|
|
12752
12752
|
] }),
|
|
12753
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: "flex items-center gap-3 p-3 border border-border rounded-lg cursor-pointer hover:bg-surface-hover transition-colors", children: [
|
|
12753
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: "flex items-start sm:items-center gap-3 p-3 border border-border rounded-lg cursor-pointer hover:bg-surface-hover transition-colors", children: [
|
|
12754
12754
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
12755
12755
|
"input",
|
|
12756
12756
|
{
|
|
@@ -12758,11 +12758,11 @@ function RepositoryWizard({ repoPath, onClose, onSuccess }) {
|
|
|
12758
12758
|
name: "action",
|
|
12759
12759
|
checked: action === "local",
|
|
12760
12760
|
onChange: () => setAction("local"),
|
|
12761
|
-
className: "text-brand focus:ring-brand accent-brand"
|
|
12761
|
+
className: "text-brand focus:ring-brand accent-brand mt-1 sm:mt-0"
|
|
12762
12762
|
}
|
|
12763
12763
|
),
|
|
12764
12764
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
12765
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-primary font-semibold", children: "Local Repository Only" }),
|
|
12765
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-primary font-semibold text-sm sm:text-base", children: "Local Repository Only" }),
|
|
12766
12766
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-secondary text-xs", children: "Initialize Git locally without GitHub." })
|
|
12767
12767
|
] })
|
|
12768
12768
|
] })
|
|
@@ -12776,7 +12776,7 @@ function RepositoryWizard({ repoPath, onClose, onSuccess }) {
|
|
|
12776
12776
|
type: "text",
|
|
12777
12777
|
value: repoName,
|
|
12778
12778
|
onChange: (e) => setRepoName(e.target.value),
|
|
12779
|
-
className: "w-full bg-surface-hover border border-border rounded-md px-3 py-2 text-sm text-primary focus:outline-none focus:border-accent"
|
|
12779
|
+
className: "w-full bg-surface-hover border border-border rounded-md px-3 py-2 text-sm text-primary focus:outline-none focus:border-accent transition-colors"
|
|
12780
12780
|
}
|
|
12781
12781
|
)
|
|
12782
12782
|
] }),
|
|
@@ -12788,7 +12788,7 @@ function RepositoryWizard({ repoPath, onClose, onSuccess }) {
|
|
|
12788
12788
|
type: "text",
|
|
12789
12789
|
value: repoDesc,
|
|
12790
12790
|
onChange: (e) => setRepoDesc(e.target.value),
|
|
12791
|
-
className: "w-full bg-surface-hover border border-border rounded-md px-3 py-2 text-sm text-primary focus:outline-none focus:border-accent"
|
|
12791
|
+
className: "w-full bg-surface-hover border border-border rounded-md px-3 py-2 text-sm text-primary focus:outline-none focus:border-accent transition-colors"
|
|
12792
12792
|
}
|
|
12793
12793
|
)
|
|
12794
12794
|
] }),
|
|
@@ -12817,7 +12817,7 @@ function RepositoryWizard({ repoPath, onClose, onSuccess }) {
|
|
|
12817
12817
|
),
|
|
12818
12818
|
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm text-primary", children: "Add a README file" })
|
|
12819
12819
|
] }),
|
|
12820
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
12820
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
|
|
12821
12821
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
12822
12822
|
/* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "block text-xs font-semibold text-secondary mb-1", children: "Add .gitignore" }),
|
|
12823
12823
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
@@ -12825,7 +12825,7 @@ function RepositoryWizard({ repoPath, onClose, onSuccess }) {
|
|
|
12825
12825
|
{
|
|
12826
12826
|
value: gitignoreTemplate,
|
|
12827
12827
|
onChange: (e) => setGitignoreTemplate(e.target.value),
|
|
12828
|
-
className: "w-full bg-surface-hover border border-border rounded-md px-3 py-2 text-sm text-primary focus:outline-none focus:border-accent appearance-none cursor-pointer",
|
|
12828
|
+
className: "w-full bg-surface-hover border border-border rounded-md px-3 py-2 text-sm text-primary focus:outline-none focus:border-accent appearance-none cursor-pointer transition-colors",
|
|
12829
12829
|
children: [
|
|
12830
12830
|
/* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: "", children: "None" }),
|
|
12831
12831
|
/* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: "Node", children: "Node" }),
|
|
@@ -12844,7 +12844,7 @@ function RepositoryWizard({ repoPath, onClose, onSuccess }) {
|
|
|
12844
12844
|
{
|
|
12845
12845
|
value: licenseTemplate,
|
|
12846
12846
|
onChange: (e) => setLicenseTemplate(e.target.value),
|
|
12847
|
-
className: "w-full bg-surface-hover border border-border rounded-md px-3 py-2 text-sm text-primary focus:outline-none focus:border-accent appearance-none cursor-pointer",
|
|
12847
|
+
className: "w-full bg-surface-hover border border-border rounded-md px-3 py-2 text-sm text-primary focus:outline-none focus:border-accent appearance-none cursor-pointer transition-colors",
|
|
12848
12848
|
children: [
|
|
12849
12849
|
/* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: "", children: "None" }),
|
|
12850
12850
|
/* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: "mit", children: "MIT License" }),
|
|
@@ -12865,7 +12865,7 @@ function RepositoryWizard({ repoPath, onClose, onSuccess }) {
|
|
|
12865
12865
|
{
|
|
12866
12866
|
value: selectedRepoUrl,
|
|
12867
12867
|
onChange: (e) => setSelectedRepoUrl(e.target.value),
|
|
12868
|
-
className: "w-full bg-surface-hover border border-border rounded-md px-3 py-2 text-sm text-primary focus:outline-none focus:border-accent appearance-none",
|
|
12868
|
+
className: "w-full bg-surface-hover border border-border rounded-md px-3 py-2 text-sm text-primary focus:outline-none focus:border-accent appearance-none transition-colors",
|
|
12869
12869
|
children: userRepos.map((r) => /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: r.clone_url, children: r.full_name }, r.id))
|
|
12870
12870
|
}
|
|
12871
12871
|
)
|
|
@@ -12875,7 +12875,7 @@ function RepositoryWizard({ repoPath, onClose, onSuccess }) {
|
|
|
12875
12875
|
{
|
|
12876
12876
|
onClick: handleProceed,
|
|
12877
12877
|
disabled: isLoading,
|
|
12878
|
-
className: "flex-1 py-2 bg-brand hover:bg-brand-hover border border-white/10 text-white rounded-md font-semibold transition-all disabled:opacity-50",
|
|
12878
|
+
className: "flex-1 py-2 sm:py-3 bg-brand hover:bg-brand-hover border border-white/10 text-white rounded-md font-semibold transition-all shadow-[0_0_15px_rgba(37,99,235,0.2)] hover:shadow-[0_0_25px_rgba(37,99,235,0.4)] disabled:opacity-50 disabled:shadow-none",
|
|
12879
12879
|
children: isLoading ? "Processing..." : "Proceed"
|
|
12880
12880
|
}
|
|
12881
12881
|
) })
|
|
@@ -23355,34 +23355,34 @@ function WelcomeWizard({ onComplete }) {
|
|
|
23355
23355
|
onComplete();
|
|
23356
23356
|
}, 1e3);
|
|
23357
23357
|
};
|
|
23358
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "fixed inset-0 z-[999] bg-gray-900 text-white font-sans flex items-center justify-center overflow-hidden animate-fade-in", children: [
|
|
23358
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "fixed inset-0 z-[999] bg-gray-900 text-white font-sans flex items-center justify-center overflow-hidden animate-fade-in p-4 sm:p-6", children: [
|
|
23359
23359
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "absolute inset-0 z-0 opacity-20 pointer-events-none", children: [
|
|
23360
23360
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "absolute top-[-20%] left-[-10%] w-[50%] h-[50%] bg-blue-600 rounded-full blur-[120px] mix-blend-screen animate-pulse" }),
|
|
23361
23361
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "absolute bottom-[-20%] right-[-10%] w-[60%] h-[60%] bg-purple-600 rounded-full blur-[150px] mix-blend-screen animate-pulse animation-delay-2000" })
|
|
23362
23362
|
] }),
|
|
23363
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative z-10 w-full max-w-2xl
|
|
23364
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex h-1.5 w-full bg-
|
|
23363
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative z-10 w-full max-w-2xl max-h-[90vh] bg-surface rounded-2xl shadow-2xl overflow-hidden flex flex-col", children: [
|
|
23364
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex h-1.5 w-full bg-surface-hover shrink-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
23365
23365
|
"div",
|
|
23366
23366
|
{
|
|
23367
23367
|
className: "h-full bg-gradient-to-r from-blue-500 to-purple-500 transition-all duration-700 ease-out",
|
|
23368
23368
|
style: { width: `${(step - 1) / 3 * 100}%` }
|
|
23369
23369
|
}
|
|
23370
23370
|
) }),
|
|
23371
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "p-10 flex-grow flex flex-col min-h-[450px]", children: [
|
|
23372
|
-
step === 1 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col items-center justify-center flex-grow text-center animate-fade-in", children: [
|
|
23373
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: logo, alt: "Logo", className: "w-24 h-24 mb-6 drop-shadow-[0_0_15px_rgba(59,130,246,0.5)]" }),
|
|
23374
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("h1", { className: "text-4xl font-bold mb-2 bg-gradient-to-r from-white to-gray-400 bg-clip-text text-transparent", children: "Welcome to GitElectron" }),
|
|
23375
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xl text-gray-400 mb-10 font-light", children: "I just write code. GitElectron takes care of Git." }),
|
|
23376
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6 w-full mb-12 text-left px-
|
|
23377
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-
|
|
23378
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "font-semibold text-blue-400 mb-2 text-lg", children: "Invisible Auto-Sync" }),
|
|
23379
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-400 leading-relaxed", children: "Silently watches your files and pushes to GitHub automatically." })
|
|
23371
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "p-6 sm:p-10 flex-grow flex flex-col min-h-[400px] sm:min-h-[450px] overflow-y-auto", children: [
|
|
23372
|
+
step === 1 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col items-center justify-center flex-grow text-center animate-fade-in py-4", children: [
|
|
23373
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: logo, alt: "Logo", className: "w-20 h-20 sm:w-24 sm:h-24 mb-6 drop-shadow-[0_0_15px_rgba(59,130,246,0.5)]" }),
|
|
23374
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h1", { className: "text-3xl sm:text-4xl font-bold mb-2 bg-gradient-to-r from-white to-gray-400 bg-clip-text text-transparent", children: "Welcome to GitElectron" }),
|
|
23375
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-lg sm:text-xl text-gray-400 mb-8 sm:mb-10 font-light px-4", children: "I just write code. GitElectron takes care of Git." }),
|
|
23376
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4 sm:gap-6 w-full mb-8 sm:mb-12 text-left px-2 sm:px-0", children: [
|
|
23377
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-surface-hover/50 p-5 sm:p-6 rounded-xl border border-border flex flex-col justify-center transition-transform hover:scale-[1.02] hover:bg-surface-hover/80", children: [
|
|
23378
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "font-semibold text-blue-400 mb-2 text-base sm:text-lg", children: "Invisible Auto-Sync" }),
|
|
23379
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs sm:text-sm text-gray-400 leading-relaxed", children: "Silently watches your files and pushes to GitHub automatically." })
|
|
23380
23380
|
] }),
|
|
23381
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-
|
|
23382
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "font-semibold text-purple-400 mb-2 text-lg", children: "Universal CLI" }),
|
|
23383
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-sm text-gray-400 leading-relaxed", children: [
|
|
23381
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-surface-hover/50 p-5 sm:p-6 rounded-xl border border-border flex flex-col justify-center transition-transform hover:scale-[1.02] hover:bg-surface-hover/80", children: [
|
|
23382
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "font-semibold text-purple-400 mb-2 text-base sm:text-lg", children: "Universal CLI" }),
|
|
23383
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-xs sm:text-sm text-gray-400 leading-relaxed", children: [
|
|
23384
23384
|
"Run ",
|
|
23385
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("code", { className: "bg-
|
|
23385
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("code", { className: "bg-canvas px-1 py-0.5 rounded text-purple-300", children: "gitelectron open" }),
|
|
23386
23386
|
" from any terminal to launch instantly."
|
|
23387
23387
|
] })
|
|
23388
23388
|
] })
|
|
@@ -23391,7 +23391,7 @@ function WelcomeWizard({ onComplete }) {
|
|
|
23391
23391
|
"button",
|
|
23392
23392
|
{
|
|
23393
23393
|
onClick: () => setStep(2),
|
|
23394
|
-
className: "group relative px-8 py-3 bg-blue-600 hover:bg-blue-500 text-white rounded-full font-bold transition-all shadow-[0_0_20px_rgba(37,99,235,0.4)] hover:shadow-[0_0_30px_rgba(37,99,235,0.6)] flex items-center gap-2",
|
|
23394
|
+
className: "group relative px-6 sm:px-8 py-3 bg-blue-600 hover:bg-blue-500 text-white rounded-full font-bold transition-all shadow-[0_0_20px_rgba(37,99,235,0.4)] hover:shadow-[0_0_30px_rgba(37,99,235,0.6)] flex items-center gap-2 mt-auto",
|
|
23395
23395
|
children: [
|
|
23396
23396
|
"Get Started",
|
|
23397
23397
|
/* @__PURE__ */ jsxRuntimeExports.jsx(FiChevronRight, { className: "group-hover:translate-x-1 transition-transform" })
|
|
@@ -23399,82 +23399,82 @@ function WelcomeWizard({ onComplete }) {
|
|
|
23399
23399
|
}
|
|
23400
23400
|
)
|
|
23401
23401
|
] }),
|
|
23402
|
-
step === 2 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col items-center justify-center flex-grow animate-fade-in", children: [
|
|
23403
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(FiGithub, { className: "text-6xl text-gray-300 mb-6" }),
|
|
23404
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-3xl font-bold mb-3", children: "Connect GitHub" }),
|
|
23405
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-gray-400 mb-8 text-center max-w-md", children: "Securely link your GitHub account using OAuth. Your credentials are encrypted locally by your OS keychain." }),
|
|
23402
|
+
step === 2 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col items-center justify-center flex-grow animate-fade-in py-4", children: [
|
|
23403
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(FiGithub, { className: "text-5xl sm:text-6xl text-gray-300 mb-6" }),
|
|
23404
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-2xl sm:text-3xl font-bold mb-3", children: "Connect GitHub" }),
|
|
23405
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm sm:text-base text-gray-400 mb-8 text-center max-w-md px-4", children: "Securely link your GitHub account using OAuth. Your credentials are encrypted locally by your OS keychain." }),
|
|
23406
23406
|
authStatus === "pending" && /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
23407
23407
|
"button",
|
|
23408
23408
|
{
|
|
23409
23409
|
onClick: startAuth,
|
|
23410
|
-
className: "px-8 py-3 bg-
|
|
23410
|
+
className: "px-6 sm:px-8 py-3 bg-surface-hover hover:bg-border text-white rounded-full font-bold transition-colors border border-border flex items-center gap-3",
|
|
23411
23411
|
children: [
|
|
23412
23412
|
/* @__PURE__ */ jsxRuntimeExports.jsx(FiGithub, { className: "text-xl" }),
|
|
23413
23413
|
"Authenticate Now"
|
|
23414
23414
|
]
|
|
23415
23415
|
}
|
|
23416
23416
|
),
|
|
23417
|
-
authStatus === "waiting" && deviceFlowData && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-
|
|
23417
|
+
authStatus === "waiting" && deviceFlowData && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-surface/80 p-5 sm:p-6 rounded-xl border border-border text-center w-full max-w-sm", children: [
|
|
23418
23418
|
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-400 mb-2", children: "Your Device Code:" }),
|
|
23419
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-4xl font-mono tracking-widest text-blue-400 font-bold mb-4 bg-
|
|
23420
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-sm text-gray-500 mb-4", children: [
|
|
23419
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-3xl sm:text-4xl font-mono tracking-widest text-blue-400 font-bold mb-4 bg-canvas py-3 rounded-lg border border-border break-all px-2", children: deviceFlowData.user_code }),
|
|
23420
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-xs sm:text-sm text-gray-500 mb-4 px-2", children: [
|
|
23421
23421
|
"Your browser should open automatically. If not, go to",
|
|
23422
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("a", { href: deviceFlowData.verification_uri, target: "_blank", rel: "noreferrer", className: "text-blue-400 ml-1 hover:underline", children: deviceFlowData.verification_uri })
|
|
23422
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("a", { href: deviceFlowData.verification_uri, target: "_blank", rel: "noreferrer", className: "text-blue-400 ml-1 hover:underline break-all block mt-1", children: deviceFlowData.verification_uri })
|
|
23423
23423
|
] }),
|
|
23424
23424
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex justify-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-6 h-6 border-2 border-blue-500 border-t-transparent rounded-full animate-spin" }) })
|
|
23425
23425
|
] }),
|
|
23426
23426
|
authStatus === "success" && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col items-center text-green-400", children: [
|
|
23427
23427
|
/* @__PURE__ */ jsxRuntimeExports.jsx(FiCheckCircle, { className: "text-5xl mb-3" }),
|
|
23428
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-bold text-lg", children: "Successfully Authenticated!" })
|
|
23428
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-bold text-lg text-center", children: "Successfully Authenticated!" })
|
|
23429
23429
|
] }),
|
|
23430
23430
|
authStatus === "error" && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-center", children: [
|
|
23431
23431
|
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-red-400 font-bold mb-2", children: "Authentication Failed" }),
|
|
23432
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-500 mb-4", children: authError }),
|
|
23432
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-500 mb-4 px-4", children: authError }),
|
|
23433
23433
|
/* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: () => setAuthStatus("pending"), className: "text-blue-400 hover:underline", children: "Try Again" })
|
|
23434
23434
|
] })
|
|
23435
23435
|
] }),
|
|
23436
|
-
step === 3 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col items-center justify-center flex-grow animate-fade-in", children: [
|
|
23437
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(FiShield, { className: "text-5xl text-purple-400 mb-4" }),
|
|
23438
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-3xl font-bold mb-2", children: "Set Lockscreen PIN" }),
|
|
23439
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-gray-400 mb-8 text-center max-w-sm", children: "GitElectron locks itself when idle to protect your code. Enter a 3-digit PIN." }),
|
|
23440
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex gap-4 justify-center mb-8", children: [0, 1, 2].map((i) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
23436
|
+
step === 3 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col items-center justify-center flex-grow animate-fade-in py-4", children: [
|
|
23437
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(FiShield, { className: "text-4xl sm:text-5xl text-purple-400 mb-4" }),
|
|
23438
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-2xl sm:text-3xl font-bold mb-2 text-center", children: "Set Lockscreen PIN" }),
|
|
23439
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm sm:text-base text-gray-400 mb-6 sm:mb-8 text-center max-w-sm px-4", children: "GitElectron locks itself when idle to protect your code. Enter a 3-digit PIN." }),
|
|
23440
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex gap-4 justify-center mb-6 sm:mb-8", children: [0, 1, 2].map((i) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
23441
23441
|
"div",
|
|
23442
23442
|
{
|
|
23443
|
-
className: `w-4 h-4 rounded-full transition-all duration-300 ${i < pinInput.length ? "bg-purple-500 scale-110 shadow-[0_0_10px_rgba(168,85,247,0.8)]" : "bg-
|
|
23443
|
+
className: `w-3 h-3 sm:w-4 sm:h-4 rounded-full transition-all duration-300 ${i < pinInput.length ? "bg-purple-500 scale-110 shadow-[0_0_10px_rgba(168,85,247,0.8)]" : "bg-border"}`
|
|
23444
23444
|
},
|
|
23445
23445
|
i
|
|
23446
23446
|
)) }),
|
|
23447
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-3 gap-4 w-64", children: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "*", "0", "#"].map((key) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
23447
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-3 gap-3 sm:gap-4 w-56 sm:w-64", children: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "*", "0", "#"].map((key) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
23448
23448
|
"button",
|
|
23449
23449
|
{
|
|
23450
23450
|
onClick: () => handleNumpadPress(key),
|
|
23451
|
-
className: "w-full aspect-square flex items-center justify-center text-2xl font-bold rounded-xl bg-
|
|
23451
|
+
className: "w-full aspect-square flex items-center justify-center text-xl sm:text-2xl font-bold rounded-xl bg-surface-hover/80 hover:bg-surface border border-border transition-colors",
|
|
23452
23452
|
children: key
|
|
23453
23453
|
},
|
|
23454
23454
|
key
|
|
23455
23455
|
)) }),
|
|
23456
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-64 mt-4", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
23456
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-56 sm:w-64 mt-4", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
23457
23457
|
"button",
|
|
23458
23458
|
{
|
|
23459
23459
|
onClick: handleNumpadDelete,
|
|
23460
23460
|
disabled: pinInput.length === 0,
|
|
23461
|
-
className: "w-full py-3 flex items-center justify-center text-xl font-bold rounded-xl bg-
|
|
23461
|
+
className: "w-full py-2 sm:py-3 flex items-center justify-center text-lg sm:text-xl font-bold rounded-xl bg-surface-hover/80 hover:bg-surface border border-border transition-colors text-gray-400 disabled:opacity-30 disabled:hover:bg-surface-hover/80",
|
|
23462
23462
|
children: "DEL"
|
|
23463
23463
|
}
|
|
23464
23464
|
) })
|
|
23465
23465
|
] }),
|
|
23466
|
-
step === 4 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `flex flex-col items-center justify-center flex-grow text-center transition-opacity duration-500 ${isFinishing ? "opacity-0 scale-95" : "opacity-100 animate-fade-in"}`, children: [
|
|
23466
|
+
step === 4 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `flex flex-col items-center justify-center flex-grow text-center transition-opacity duration-500 ${isFinishing ? "opacity-0 scale-95" : "opacity-100 animate-fade-in"} py-4`, children: [
|
|
23467
23467
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative mb-6", children: [
|
|
23468
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(FiCheckCircle, { className: "text-7xl text-blue-500 relative z-10" }),
|
|
23468
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(FiCheckCircle, { className: "text-6xl sm:text-7xl text-blue-500 relative z-10" }),
|
|
23469
23469
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "absolute inset-0 bg-blue-500 rounded-full blur-[20px] opacity-50 z-0" })
|
|
23470
23470
|
] }),
|
|
23471
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-4xl font-bold mb-3", children: "You're All Set!" }),
|
|
23472
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xl text-gray-400 mb-10 max-w-md", children: "Your environment is secured and connected. You can now drag and drop any folder to start Auto-Syncing." }),
|
|
23471
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-3xl sm:text-4xl font-bold mb-3", children: "You're All Set!" }),
|
|
23472
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-lg sm:text-xl text-gray-400 mb-8 sm:mb-10 max-w-md px-4", children: "Your environment is secured and connected. You can now drag and drop any folder to start Auto-Syncing." }),
|
|
23473
23473
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
23474
23474
|
"button",
|
|
23475
23475
|
{
|
|
23476
23476
|
onClick: finishSetup,
|
|
23477
|
-
className: "px-10 py-4 bg-gradient-to-r from-blue-600 to-purple-600 hover:from-blue-500 hover:to-purple-500 text-white rounded-full font-bold text-lg transition-all shadow-[0_0_20px_rgba(139,92,246,0.4)] hover:shadow-[0_0_30px_rgba(139,92,246,0.6)] hover:scale-105",
|
|
23477
|
+
className: "px-8 sm:px-10 py-3 sm:py-4 bg-gradient-to-r from-blue-600 to-purple-600 hover:from-blue-500 hover:to-purple-500 text-white rounded-full font-bold text-base sm:text-lg transition-all shadow-[0_0_20px_rgba(139,92,246,0.4)] hover:shadow-[0_0_30px_rgba(139,92,246,0.6)] hover:scale-105",
|
|
23478
23478
|
children: "Launch GitElectron"
|
|
23479
23479
|
}
|
|
23480
23480
|
)
|
|
@@ -24613,6 +24613,7 @@ function App() {
|
|
|
24613
24613
|
const [autoSyncLogs, setAutoSyncLogs] = reactExports.useState([]);
|
|
24614
24614
|
const [showAutoSyncLogs, setShowAutoSyncLogs] = reactExports.useState(false);
|
|
24615
24615
|
const [isRefreshing, setIsRefreshing] = reactExports.useState(false);
|
|
24616
|
+
const refreshLockRef = reactExports.useRef(false);
|
|
24616
24617
|
const [showWelcomeWizard, setShowWelcomeWizard] = reactExports.useState(false);
|
|
24617
24618
|
const [newPin, setNewPin] = reactExports.useState("");
|
|
24618
24619
|
const [pinChangeSuccess, setPinChangeSuccess] = reactExports.useState(false);
|
|
@@ -24777,7 +24778,7 @@ function App() {
|
|
|
24777
24778
|
if (isRepo && repoPath) {
|
|
24778
24779
|
interval = setInterval(() => {
|
|
24779
24780
|
refreshRepoState();
|
|
24780
|
-
},
|
|
24781
|
+
}, 12e4);
|
|
24781
24782
|
}
|
|
24782
24783
|
return () => {
|
|
24783
24784
|
if (interval) clearInterval(interval);
|
|
@@ -24943,6 +24944,8 @@ function App() {
|
|
|
24943
24944
|
}
|
|
24944
24945
|
};
|
|
24945
24946
|
const refreshRepoState = async () => {
|
|
24947
|
+
if (refreshLockRef.current) return;
|
|
24948
|
+
refreshLockRef.current = true;
|
|
24946
24949
|
setIsRefreshing(true);
|
|
24947
24950
|
try {
|
|
24948
24951
|
setErrorMsg("");
|
|
@@ -24956,28 +24959,6 @@ function App() {
|
|
|
24956
24959
|
setDeletedHistory(dh);
|
|
24957
24960
|
} catch (err) {
|
|
24958
24961
|
}
|
|
24959
|
-
try {
|
|
24960
|
-
const b = await window.api.getBranches();
|
|
24961
|
-
setBranches(b);
|
|
24962
|
-
const updatedStatus = await window.api.getStatus();
|
|
24963
|
-
setStatus(updatedStatus);
|
|
24964
|
-
if (autoSyncEnabled && updatedStatus.behind > 0) {
|
|
24965
|
-
const remotes2 = await window.api.getRemotes();
|
|
24966
|
-
if (remotes2.length > 0) {
|
|
24967
|
-
try {
|
|
24968
|
-
showToast(`Auto-Push: Downloading ${updatedStatus.behind} remote change(s)...`, "info");
|
|
24969
|
-
await window.api.pullFromRemote(remotes2[0].name, b.current);
|
|
24970
|
-
showToast("Auto-Push: Successfully synchronized remote changes!", "success");
|
|
24971
|
-
const finalStatus = await window.api.getStatus();
|
|
24972
|
-
setStatus(finalStatus);
|
|
24973
|
-
} catch (e) {
|
|
24974
|
-
console.error("Auto-Push Pull failed:", e);
|
|
24975
|
-
}
|
|
24976
|
-
}
|
|
24977
|
-
}
|
|
24978
|
-
} catch (e) {
|
|
24979
|
-
setBranches({ current: "No commits yet", all: [] });
|
|
24980
|
-
}
|
|
24981
24962
|
const auth = await window.api.getAuthStatus();
|
|
24982
24963
|
setAuthStatus(auth);
|
|
24983
24964
|
const accs = await window.api.getAccounts();
|
|
@@ -25009,32 +24990,58 @@ function App() {
|
|
|
25009
24990
|
} else {
|
|
25010
24991
|
setRemoteUrl(null);
|
|
25011
24992
|
}
|
|
25012
|
-
|
|
25013
|
-
|
|
25014
|
-
|
|
25015
|
-
const
|
|
25016
|
-
|
|
25017
|
-
|
|
25018
|
-
|
|
25019
|
-
|
|
25020
|
-
|
|
25021
|
-
|
|
24993
|
+
const deferredRemotes = remotes;
|
|
24994
|
+
(async () => {
|
|
24995
|
+
try {
|
|
24996
|
+
const b = await window.api.getBranches();
|
|
24997
|
+
setBranches(b);
|
|
24998
|
+
const updatedStatus = await window.api.getStatus();
|
|
24999
|
+
setStatus(updatedStatus);
|
|
25000
|
+
if (autoSyncEnabled && updatedStatus.behind > 0) {
|
|
25001
|
+
if (deferredRemotes.length > 0) {
|
|
25002
|
+
try {
|
|
25003
|
+
showToast(`Auto-Push: Downloading ${updatedStatus.behind} remote change(s)...`, "info");
|
|
25004
|
+
await window.api.pullFromRemote(deferredRemotes[0].name, b.current);
|
|
25005
|
+
showToast("Auto-Push: Successfully synchronized remote changes!", "success");
|
|
25006
|
+
const finalStatus = await window.api.getStatus();
|
|
25007
|
+
setStatus(finalStatus);
|
|
25008
|
+
} catch (e) {
|
|
25009
|
+
console.error("Auto-Push Pull failed:", e);
|
|
25010
|
+
}
|
|
25011
|
+
}
|
|
25022
25012
|
}
|
|
25023
|
-
|
|
25024
|
-
|
|
25025
|
-
|
|
25026
|
-
|
|
25027
|
-
|
|
25028
|
-
|
|
25013
|
+
} catch (e) {
|
|
25014
|
+
setBranches({ current: "No commits yet", all: [] });
|
|
25015
|
+
}
|
|
25016
|
+
})();
|
|
25017
|
+
if (auth.status === "Verified") {
|
|
25018
|
+
if (deferredRemotes.length > 0) {
|
|
25019
|
+
const remoteUrl2 = deferredRemotes[0].refs.push;
|
|
25020
|
+
(async () => {
|
|
25021
|
+
try {
|
|
25022
|
+
const hasPerm = await window.api.verifyPushPermission(remoteUrl2);
|
|
25023
|
+
setPushPermission(hasPerm);
|
|
25024
|
+
} catch (e) {
|
|
25025
|
+
console.error("Failed to verify push permission", e);
|
|
25029
25026
|
}
|
|
25030
|
-
|
|
25031
|
-
|
|
25032
|
-
|
|
25027
|
+
try {
|
|
25028
|
+
const invs = await window.api.getUserInvitations();
|
|
25029
|
+
setInvitations(invs || []);
|
|
25030
|
+
} catch (e) {
|
|
25031
|
+
console.error("Failed to fetch invitations", e);
|
|
25033
25032
|
}
|
|
25034
|
-
|
|
25035
|
-
|
|
25036
|
-
|
|
25037
|
-
|
|
25033
|
+
try {
|
|
25034
|
+
const collabData = await window.api.getCollaborators(remoteUrl2);
|
|
25035
|
+
setRepoCollaborators(collabData.collaborators || []);
|
|
25036
|
+
if (remoteUrl2 && repoPath) {
|
|
25037
|
+
const cleaned = remoteUrl2.replace("https://github.com/", "").replace(/\.git$/, "");
|
|
25038
|
+
saveMapping(cleaned, repoPath);
|
|
25039
|
+
}
|
|
25040
|
+
} catch (e) {
|
|
25041
|
+
console.error("Failed to fetch collaborators", e);
|
|
25042
|
+
setRepoCollaborators([]);
|
|
25043
|
+
}
|
|
25044
|
+
})();
|
|
25038
25045
|
} else {
|
|
25039
25046
|
setPushPermission(true);
|
|
25040
25047
|
}
|
|
@@ -25072,6 +25079,7 @@ function App() {
|
|
|
25072
25079
|
}
|
|
25073
25080
|
} finally {
|
|
25074
25081
|
setIsRefreshing(false);
|
|
25082
|
+
refreshLockRef.current = false;
|
|
25075
25083
|
}
|
|
25076
25084
|
};
|
|
25077
25085
|
const handleCreateBranchSubmit = async (name, base) => {
|