Fixing share link
This commit is contained in:
@ -60,17 +60,24 @@ export function TopBar() {
|
||||
uiOpacity: settings.uiOpacity,
|
||||
};
|
||||
|
||||
const encoded = btoa(JSON.stringify(shareData));
|
||||
window.location.hash = encoded;
|
||||
try {
|
||||
const encoded = btoa(JSON.stringify(shareData));
|
||||
const url = `${window.location.origin}${window.location.pathname}#${encoded}`;
|
||||
|
||||
navigator.clipboard
|
||||
.writeText(window.location.href)
|
||||
.then(() => {
|
||||
console.log('URL copied to clipboard');
|
||||
})
|
||||
.catch(() => {
|
||||
console.log('Copy failed');
|
||||
});
|
||||
console.log('Sharing URL:', url);
|
||||
console.log('Share data:', shareData);
|
||||
|
||||
navigator.clipboard
|
||||
.writeText(url)
|
||||
.then(() => {
|
||||
console.log('URL copied to clipboard');
|
||||
})
|
||||
.catch(() => {
|
||||
console.log('Copy failed');
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('Failed to create share URL:', error);
|
||||
}
|
||||
};
|
||||
|
||||
const handleExportPNG = () => {
|
||||
@ -151,7 +158,9 @@ export function TopBar() {
|
||||
Value Mode:
|
||||
<select
|
||||
value={settings.valueMode}
|
||||
onChange={(e) => updateAppSettings({ valueMode: e.target.value as ValueMode })}
|
||||
onChange={(e) =>
|
||||
updateAppSettings({ valueMode: e.target.value as ValueMode })
|
||||
}
|
||||
style={{
|
||||
background: 'rgba(255,255,255,0.1)',
|
||||
border: '1px solid #555',
|
||||
|
||||
Reference in New Issue
Block a user