mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-05 16:23:36 +00:00
Merge remote-tracking branch 'origin/main' into pr/fix-force-push-add-robustness-to-nostr-fetch-and-push(6312f9a8)
This commit is contained in:
7 files changed
+49
-2
No files matched your search
@@ -58,8 +58,14 @@ export function AppProvider(props: AppProviderProps) {
|
||||
setConfig(updater);
|
||||
};
|
||||
|
||||
// Merge default config with stored config
|
||||
const config = { ...defaultConfig, ...rawConfig };
|
||||
|
||||
// Expand filesystem paths
|
||||
config.fsPathConfig = expandPath(config.fsPathConfig);
|
||||
config.fsPathProjects = expandPath(config.fsPathProjects);
|
||||
config.fsPathTmp = expandPath(config.fsPathTmp);
|
||||
|
||||
const appContextValue: AppContextType = {
|
||||
config,
|
||||
updateConfig,
|
||||
@@ -127,4 +133,18 @@ function useApplyLanguage(language?: string): void {
|
||||
useEffect(() => {
|
||||
i18n.changeLanguage(language ?? navigator.language);
|
||||
}, [language]);
|
||||
}
|
||||
|
||||
/** Expand FS paths with the user's home directory, if available. */
|
||||
function expandPath(path: string): string {
|
||||
const homedir = window.electron?.homedir;
|
||||
if (!homedir) {
|
||||
return path;
|
||||
} else if (path.startsWith('~/')) {
|
||||
return homedir + path.slice(1);
|
||||
} else if (path === '~') {
|
||||
return homedir;
|
||||
} else {
|
||||
return path;
|
||||
}
|
||||
}
|
||||
@@ -554,7 +554,14 @@ export function CreditsDialog({ open, onOpenChange, provider }: CreditsDialogPro
|
||||
};
|
||||
|
||||
const handleCopyCode = (code: string) => {
|
||||
navigator.clipboard.writeText(code);
|
||||
// Create the full shareable URL for the gift card
|
||||
const url = new URL('/giftcard', window.location.origin);
|
||||
url.hash = new URLSearchParams({
|
||||
baseURL: provider.baseURL,
|
||||
code: code,
|
||||
}).toString();
|
||||
|
||||
navigator.clipboard.writeText(url.toString());
|
||||
setCopiedCode(code);
|
||||
setTimeout(() => setCopiedCode(null), 2000);
|
||||
};
|
||||
|
||||
@@ -51,7 +51,7 @@ export function PWAUpdatePrompt() {
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="fixed bottom-4 left-1/2 -translate-x-1/2 md:top-4 md:right-4 md:bottom-auto md:left-auto md:translate-x-0 z-50 animate-in slide-in-from-bottom-4 md:slide-in-from-top-4 duration-500 max-w-full truncate">
|
||||
<div className="fixed bottom-4 left-1/2 -translate-x-1/2 md:top-4 md:right-4 md:bottom-auto md:left-auto md:translate-x-0 z-50 animate-in slide-in-from-bottom-4 md:slide-in-from-top-4 duration-500 max-w-full">
|
||||
<button
|
||||
onClick={handleUpdate}
|
||||
disabled={isUpdating}
|
||||
|
||||
@@ -115,6 +115,16 @@ export function AboutSettings() {
|
||||
<ExternalLink className="ml-auto h-4 w-4" />
|
||||
</a>
|
||||
</Button>
|
||||
<Button
|
||||
variant="outline"
|
||||
className="w-full h-10 flex items-center gap-2 justify-start"
|
||||
asChild
|
||||
>
|
||||
<a href="https://shakespeare-diy.github.io" target="_blank" rel="noopener noreferrer">
|
||||
<span className="font-mono text-sm">shakespeare-diy.github.io</span>
|
||||
<ExternalLink className="ml-auto h-4 w-4" />
|
||||
</a>
|
||||
</Button>
|
||||
<Button
|
||||
variant="outline"
|
||||
className="w-full h-10 flex items-center gap-2 justify-start"
|
||||
|
||||
Reference in new issue
Block a user