Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 34 additions & 11 deletions src/app/components/StampListSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,20 @@ const StampListSection: React.FC<StampListSectionProps> = ({
void fetchStamps();
}, [address, beeApiUrl, nodeAddress, beeHealth.status, isBeeHealthProbing]);

const handleHardReset = () => {
const confirmed = window.confirm(
'Refresh storage list? This clears the local expired-stamps cache and reloads the page. Only use this if your storage list looks incorrect.'
);
if (!confirmed) return;

try {
localStorage.removeItem(EXPIRED_STAMPS_CACHE_KEY);
window.location.reload();
} catch (error) {
console.error('Error clearing expired stamps cache:', error);
}
};

// Function to refresh a specific stamp
const refreshSingleStamp = async (stampToRefresh: BatchEvent) => {
if (!address || beeNodeBlocks) return;
Expand Down Expand Up @@ -839,19 +853,28 @@ const StampListSection: React.FC<StampListSectionProps> = ({
{/* Hard reset button - discrete at bottom */}
<div className={styles.resetButtonContainer}>
<button
type="button"
className={styles.resetButton}
onClick={() => {
try {
localStorage.removeItem(EXPIRED_STAMPS_CACHE_KEY);
// Trigger a refresh of the stamp list
window.location.reload();
} catch (error) {
console.error('Error clearing expired stamps cache:', error);
}
}}
title="Hard reset data"
onClick={handleHardReset}
title="Refresh storage list (clears cache and reloads)"
aria-label="Refresh storage list"
>
⚙️
<svg
xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
aria-hidden
>
<polyline points="23 4 23 10 17 10" />
<polyline points="1 20 1 14 7 14" />
<path d="M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15" />
</svg>
</button>
</div>
</div>
Expand Down
3 changes: 3 additions & 0 deletions src/app/components/css/StampListSection.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,9 @@
}

.resetButton {
display: inline-flex;
align-items: center;
justify-content: center;
background: transparent;
border: 1px solid #30363d;
color: #8b949e;
Expand Down
30 changes: 7 additions & 23 deletions src/app/components/css/SwapComponent.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -458,29 +458,6 @@
color: #ffffff;
}

.tooltip {
cursor: help;
font-size: 12px;
font-weight: bold;
color: #8b949e;
background: none;
border: 1px solid #8b949e;
border-radius: 50%;
width: 16px;
height: 16px;
display: inline-flex;
align-items: center;
justify-content: center;
transition: all 0.2s ease;
line-height: 1;
}

.tooltip:hover {
color: #ff7a00;
border-color: #ff7a00;
background-color: rgba(255, 122, 0, 0.1);
}

.checkboxLabel {
font-size: 14px;
color: #8b949e;
Expand All @@ -497,11 +474,18 @@
height: 16px;
background-color: #ff7a00;
color: #ffffff;
border: none;
border-radius: 50%;
font-size: 12px;
font-weight: bold;
cursor: help;
flex-shrink: 0;
line-height: 1;
transition: background-color 0.2s ease;
}

.tooltip:hover {
background-color: #e56e00;
}

.uploadButton {
Expand Down
Loading