Remove redundant files

This commit is contained in:
Novattz
2025-11-12 15:02:13 +01:00
parent 931ecc0d92
commit 0a5f00d3fb
4 changed files with 0 additions and 147 deletions

View File

@@ -1,14 +0,0 @@
import { useUpdateChecker } from '@/hooks/useUpdateChecker'
/**
* Simple component that uses the update checker hook
* Can be dropped in anywhere in the app
*/
const UpdateNotifier = () => {
useUpdateChecker()
// This component doesn't render anything
return null
}
export default UpdateNotifier

View File

@@ -1,5 +0,0 @@
// Update checker implementation
export { default as useUpdateChecker } from '@/hooks/useUpdateChecker'
// Simple component for using the checker
export { default as UpdateNotifier } from './UpdateNotifier'

View File

@@ -1,43 +0,0 @@
import { useEffect } from 'react'
import { check } from '@tauri-apps/plugin-updater'
import { useToasts } from '@/hooks'
/**
* Hook that silently checks for updates and shows a toast notification if an update is available
*/
export function useUpdateChecker() {
const { success, error } = useToasts()
useEffect(() => {
// Check for updates on component mount
const checkForUpdates = async () => {
try {
// Check for updates
const update = await check()
// If update is available, show a toast notification
if (update) {
console.log(`Update available: ${update.version}`)
success(`Update v${update.version} available! Check GitHub for details.`, {
duration: 8000 // Show for 8 seconds
})
}
} catch (err) {
// Log error but don't show to user
console.error('Update check failed:', err)
}
}
// Small delay to avoid interfering with app startup
const timer = setTimeout(() => {
checkForUpdates()
}, 3000)
return () => clearTimeout(timer)
}, [success, error])
// This hook doesn't return anything
return null
}
export default useUpdateChecker

View File

@@ -1,85 +0,0 @@
@use '../../themes/index' as *;
@use '../../abstracts/index' as *;
/*
Update checker component styles
*/
.update-checker {
border-radius: var(--radius-md);
background-color: var(--elevated-bg);
padding: 1.25rem;
margin: 1rem 0;
border: 1px solid var(--border-soft);
box-shadow: var(--shadow-standard);
max-width: 500px;
position: fixed;
bottom: 20px;
right: 20px;
z-index: var(--z-modal) - 1;
&.error {
border-color: var(--danger);
background-color: var(--danger-soft);
}
.update-info {
margin-bottom: 1rem;
h3 {
font-size: 1.2rem;
color: var(--primary-color);
margin-bottom: 0.5rem;
font-weight: var(--bold);
}
p {
color: var(--text-secondary);
margin-bottom: 0.5rem;
font-size: 0.9rem;
}
.update-notes {
font-size: 0.85rem;
color: var(--text-soft);
max-height: 120px;
overflow-y: auto;
padding: 0.5rem;
background-color: rgba(0, 0, 0, 0.1);
border-radius: var(--radius-sm);
white-space: pre-line;
margin-top: 0.5rem;
@include custom-scrollbar;
}
}
.update-progress {
margin-top: 1rem;
.progress-bar-container {
height: 6px;
background-color: var(--border-soft);
border-radius: 3px;
margin-bottom: 0.5rem;
overflow: hidden;
}
.progress-bar {
height: 100%;
background-color: var(--primary-color);
border-radius: 3px;
transition: width 0.3s ease;
}
p {
font-size: 0.8rem;
color: var(--text-secondary);
text-align: right;
}
}
.update-actions {
display: flex;
gap: 0.75rem;
margin-top: 1rem;
}
}