Compare commits
6
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2d000bca5e | ||
|
|
c7a663c42b | ||
|
|
a182b7ca59 | ||
|
|
182acb1f21 | ||
|
|
3ff5067d49 | ||
|
|
2816a5cedb |
@@ -53,19 +53,25 @@ jobs:
|
||||
|
||||
- name: Update version-windows-beta.json on main
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
||||
shell: bash
|
||||
run: |
|
||||
notes=$(cat windows/RELEASE_NOTES.md 2>/dev/null || echo "Windows beta ${{ steps.version.outputs.version }}")
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git fetch origin main
|
||||
git checkout main
|
||||
jq -n \
|
||||
content=$(jq -n \
|
||||
--arg version "${{ steps.version.outputs.version }}" \
|
||||
--arg url "https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/ClaudeChecker-Windows.zip" \
|
||||
--arg notes "$notes" \
|
||||
'{version: $version, url: $url, notes: $notes}' > version-windows-beta.json
|
||||
git add version-windows-beta.json
|
||||
git commit -m "Windows beta release ${{ github.ref_name }}"
|
||||
git push origin main
|
||||
'{version: $version, url: $url, notes: $notes}' | base64 -w0)
|
||||
sha=$(gh api "repos/${{ github.repository }}/contents/version-windows-beta.json?ref=main" --jq .sha 2>/dev/null || echo "")
|
||||
if [ -n "$sha" ]; then
|
||||
gh api --method PUT "repos/${{ github.repository }}/contents/version-windows-beta.json" \
|
||||
--field "message=Windows beta release ${{ github.ref_name }}" \
|
||||
--field "content=$content" \
|
||||
--field "branch=main" \
|
||||
--field "sha=$sha"
|
||||
else
|
||||
gh api --method PUT "repos/${{ github.repository }}/contents/version-windows-beta.json" \
|
||||
--field "message=Windows beta release ${{ github.ref_name }}" \
|
||||
--field "content=$content" \
|
||||
--field "branch=main"
|
||||
fi
|
||||
|
||||
@@ -3,7 +3,7 @@ name: Release Windows
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'win-v*'
|
||||
- 'win-v[0-9]*'
|
||||
- '!win-v*-*'
|
||||
|
||||
jobs:
|
||||
@@ -53,19 +53,25 @@ jobs:
|
||||
|
||||
- name: Update version-windows.json on main
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
||||
shell: bash
|
||||
run: |
|
||||
notes=$(cat windows/RELEASE_NOTES.md 2>/dev/null || echo "Windows release ${{ steps.version.outputs.version }}")
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git fetch origin main
|
||||
git checkout main
|
||||
jq -n \
|
||||
content=$(jq -n \
|
||||
--arg version "${{ steps.version.outputs.version }}" \
|
||||
--arg url "https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/ClaudeChecker-Windows.zip" \
|
||||
--arg notes "$notes" \
|
||||
'{version: $version, url: $url, notes: $notes}' > version-windows.json
|
||||
git add version-windows.json
|
||||
git commit -m "Windows release ${{ github.ref_name }}"
|
||||
git push origin main
|
||||
'{version: $version, url: $url, notes: $notes}' | base64 -w0)
|
||||
sha=$(gh api "repos/${{ github.repository }}/contents/version-windows.json?ref=main" --jq .sha 2>/dev/null || echo "")
|
||||
if [ -n "$sha" ]; then
|
||||
gh api --method PUT "repos/${{ github.repository }}/contents/version-windows.json" \
|
||||
--field "message=Windows release ${{ github.ref_name }}" \
|
||||
--field "content=$content" \
|
||||
--field "branch=main" \
|
||||
--field "sha=$sha"
|
||||
else
|
||||
gh api --method PUT "repos/${{ github.repository }}/contents/version-windows.json" \
|
||||
--field "message=Windows release ${{ github.ref_name }}" \
|
||||
--field "content=$content" \
|
||||
--field "branch=main"
|
||||
fi
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
using Color = System.Windows.Media.Color;
|
||||
using Point = System.Windows.Point;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows;
|
||||
|
||||
+25
-12
@@ -1,5 +1,6 @@
|
||||
using Microsoft.Web.WebView2.Core;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
@@ -28,18 +29,25 @@ public partial class LoginWindow : Window
|
||||
{
|
||||
if (!e.IsSuccess) return;
|
||||
var uri = Browser.CoreWebView2.Source;
|
||||
if (uri.Contains("claude.ai") && !uri.Contains("/login"))
|
||||
if (!uri.Contains("claude.ai")) return;
|
||||
|
||||
var cookies = await Browser.CoreWebView2.CookieManager.GetCookiesAsync("https://claude.ai");
|
||||
var signedIn = cookies.Any(c =>
|
||||
c.Name.Equals("sessionKey", StringComparison.OrdinalIgnoreCase) ||
|
||||
c.Name.StartsWith("sk-ant", StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
await Dispatcher.InvokeAsync(() =>
|
||||
{
|
||||
// Likely signed in — enable done button
|
||||
var cookies = await Browser.CoreWebView2.CookieManager.GetCookiesAsync("https://claude.ai");
|
||||
var hasSess = cookies.Any(c => c.Name.Contains("session") || c.Name.Contains("sk-"));
|
||||
await Dispatcher.InvokeAsync(() =>
|
||||
{
|
||||
DoneButton.IsEnabled = hasSess || uri.Contains("/chats") || uri.Contains("/new");
|
||||
StatusText.Text = DoneButton.IsEnabled
|
||||
? "Signed in! Click Done to continue."
|
||||
: "Waiting for sign-in…";
|
||||
});
|
||||
DoneButton.IsEnabled = !uri.Contains("/login") && !uri.Contains("/signin");
|
||||
StatusText.Text = signedIn
|
||||
? "Signed in — click Done to continue."
|
||||
: "Complete sign-in, then click Done.";
|
||||
});
|
||||
|
||||
// Auto-close once clearly on the main app page
|
||||
if (signedIn && (uri.Contains("/chats") || uri.Contains("/new") || uri == "https://claude.ai/"))
|
||||
{
|
||||
await SaveAndClose(cookies);
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -47,7 +55,12 @@ public partial class LoginWindow : Window
|
||||
private async void Done_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var cookies = await Browser.CoreWebView2.CookieManager.GetCookiesAsync("https://claude.ai");
|
||||
await SaveAndClose(cookies);
|
||||
}
|
||||
|
||||
private async Task SaveAndClose(IReadOnlyList<CoreWebView2Cookie> cookies)
|
||||
{
|
||||
UsageViewModel.SaveCookies(cookies);
|
||||
DialogResult = true;
|
||||
await Dispatcher.InvokeAsync(() => DialogResult = true);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user