Skip to content

Commit 9a1c838

Browse files
authored
XS⚠️ ◾ change My Shaves list to use local database (#830)
* replace portal shave with local data * fix format issue * fix failing loading issue * rename last updated to updated * hide my shaves entry point * format issue fix
1 parent 4d5f9bc commit 9a1c838

12 files changed

Lines changed: 126 additions & 381 deletions

package-lock.json

Lines changed: 13 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/backend/index.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,13 +340,25 @@ if (!gotTheLock) {
340340
mainWindow.focus();
341341

342342
// Check for protocol URL in command line (Windows)
343-
const url = commandLine.find((arg) => arg.startsWith(`${customProtocol}://`));
343+
// Match any yakshaver protocol URL (covers both dev and prod protocols,
344+
// as well as custom protocols from Azure/IdentityServer config)
345+
const url = commandLine.find(
346+
(arg) =>
347+
arg.startsWith(`${customProtocol}://`) ||
348+
arg.startsWith("yakshaver-desktop-dev://") ||
349+
arg.startsWith("yakshaver-desktop://"),
350+
);
344351
if (url) {
345352
handleProtocolUrlSafely(mainWindow, url);
346353
}
347354
} else {
348355
// Store for later if window not ready yet
349-
const url = commandLine.find((arg) => arg.startsWith(`${customProtocol}://`));
356+
const url = commandLine.find(
357+
(arg) =>
358+
arg.startsWith(`${customProtocol}://`) ||
359+
arg.startsWith("yakshaver-desktop-dev://") ||
360+
arg.startsWith("yakshaver-desktop://"),
361+
);
350362
if (url) {
351363
pendingProtocolUrl = url;
352364
}

src/ui/package-lock.json

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/ui/src/components/auth/IdentityServerAuthManager.tsx

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { LogOut } from "lucide-react";
22
import { useCallback, useEffect, useState } from "react";
3-
import { MyShavesDialog } from "@/components/portal/MyShavesDialog";
43
import { Avatar, AvatarFallback } from "@/components/ui/avatar";
54
import { Button } from "@/components/ui/button";
65
import {
@@ -20,7 +19,6 @@ export function IdentityServerAuthManager() {
2019
} | null>(null);
2120
const [loading, setLoading] = useState(false);
2221
const [error, setError] = useState<string | null>(null);
23-
const [showMyShaves, setShowMyShaves] = useState(false);
2422

2523
const refresh = useCallback(async () => {
2624
setLoading(true);
@@ -98,12 +96,6 @@ export function IdentityServerAuthManager() {
9896
<div className="mb-3 pb-3 border-b border-white/10">
9997
<p className="text-sm font-medium text-white truncate">{status?.name}</p>
10098
</div>
101-
<DropdownMenuItem
102-
onClick={() => setShowMyShaves(true)}
103-
className="text-white hover:bg-white/10"
104-
>
105-
<span>My Shaves</span>
106-
</DropdownMenuItem>
10799
<DropdownMenuItem
108100
onClick={logout}
109101
disabled={loading}
@@ -116,7 +108,6 @@ export function IdentityServerAuthManager() {
116108
</DropdownMenuContent>
117109
</DropdownMenu>
118110
{error && <span className="text-ssw-red text-xs ml-2">{error}</span>}
119-
<MyShavesDialog open={showMyShaves} onOpenChange={setShowMyShaves} />
120111
</div>
121112
);
122113
}

src/ui/src/components/auth/MicrosoftAuthManager.tsx

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { LogOut } from "lucide-react";
22
import { useCallback, useEffect, useState } from "react";
3-
import { MyShavesDialog } from "@/components/portal/MyShavesDialog";
43
import { Avatar, AvatarFallback } from "@/components/ui/avatar";
54
import { Button } from "@/components/ui/button";
65
import {
@@ -21,7 +20,6 @@ export function MicrosoftAuthManager() {
2120
} | null>(null);
2221
const [loading, setLoading] = useState(false);
2322
const [error, setError] = useState<string | null>(null);
24-
const [showMyShaves, setShowMyShaves] = useState(false);
2523

2624
const refresh = useCallback(async () => {
2725
setLoading(true);
@@ -98,12 +96,6 @@ export function MicrosoftAuthManager() {
9896
<div className="mb-3 pb-3 border-b border-white/10">
9997
<p className="text-sm font-medium text-white truncate">{status?.name}</p>
10098
</div>
101-
<DropdownMenuItem
102-
onClick={() => setShowMyShaves(true)}
103-
className="text-white hover:bg-white/10"
104-
>
105-
<span>My Shaves</span>
106-
</DropdownMenuItem>
10799
<DropdownMenuItem
108100
onClick={logout}
109101
disabled={loading}
@@ -116,7 +108,6 @@ export function MicrosoftAuthManager() {
116108
</DropdownMenuContent>
117109
</DropdownMenu>
118110
{error && <span className="text-ssw-red text-xs ml-2">{error}</span>}
119-
<MyShavesDialog open={showMyShaves} onOpenChange={setShowMyShaves} />
120111
</div>
121112
);
122113
}

0 commit comments

Comments
 (0)