diff --git a/src/app/main/layout.tsx b/src/app/main/layout.tsx index de2fba9..bdbb0d8 100644 --- a/src/app/main/layout.tsx +++ b/src/app/main/layout.tsx @@ -88,8 +88,6 @@ export default function RootLayout ({ const [versions, setVersions] = useState(null) const [account, setAccount] = useState(null) - const [notificationsAllowed, setNotificationsAllowed] = - useState(false) const [sidebarAlwaysShowGames, setSidebarAlwaysShowGames] = useState(false) const [linuxUseWine, setLinuxUseWine] = useState(false) @@ -232,11 +230,10 @@ export default function RootLayout ({ : d ) ) - if (await settings?.get('notificationsAllowed')) - await notifyUser( - 'Download Failed', - `The download for version ${info.displayName} has failed.` - ) + await notifyUser( + 'Download Failed', + `The download for version ${info.displayName} has failed.` + ) await getCurrentWindow().requestUserAttention( UserAttentionType.Critical ) @@ -311,11 +308,10 @@ export default function RootLayout ({ : d ) ) - if (await settings?.get('notificationsAllowed')) - await notifyUser( - 'Download Failed', - `The download for version ${info.displayName} has failed.` - ) + await notifyUser( + 'Download Failed', + `The download for version ${info.displayName} has failed.` + ) await getCurrentWindow().requestUserAttention( UserAttentionType.Critical ) @@ -647,7 +643,6 @@ export default function RootLayout ({ autoSave: true, defaults: { version: client, - notificationsAllowed: true, sidebarAlwaysShowGames: true, linuxUseWine: false, linuxWineCommand: 'wine %path%', @@ -776,23 +771,14 @@ export default function RootLayout ({ popupMode === 1 ) { setTimeout(async () => { - if (notificationsAllowed) { - await notifyUser('Downloads Complete', 'All downloads finished!') - } + await notifyUser('Downloads Complete', 'All downloads finished!') await getCurrentWindow().requestUserAttention( UserAttentionType.Informational ) closePopup() }, 0) } - }, [ - downloadProgress, - downloadQueue, - showPopup, - popupMode, - closePopup, - notificationsAllowed - ]) + }, [downloadProgress, downloadQueue, showPopup, popupMode, closePopup]) useEffect(() => { if (!settings || !versions) return @@ -814,9 +800,6 @@ export default function RootLayout ({ } watchSettings('theme', v => setTheme(v ?? 'dark')) - watchSettings('notificationsAllowed', v => - setNotificationsAllowed(v ?? true) - ) watchSettings('sidebarAlwaysShowGames', v => setSidebarAlwaysShowGames(v ?? true) ) @@ -896,7 +879,6 @@ export default function RootLayout ({ settings, versions, account, - notificationsAllowed, sidebarAlwaysShowGames, linuxUseWine, linuxWineCommand, diff --git a/src/app/main/settings/page.tsx b/src/app/main/settings/page.tsx index 8521d62..0073eec 100644 --- a/src/app/main/settings/page.tsx +++ b/src/app/main/settings/page.tsx @@ -18,7 +18,6 @@ export default function Settings () { account, version, versionsList, - notificationsAllowed, sidebarAlwaysShowGames, linuxUseWine, linuxWineCommand, @@ -33,14 +32,6 @@ export default function Settings () {

Settings

- { - await settings?.set('notificationsAllowed', !notificationsAllowed) - }} - title='This setting does as you expect, allow the launcher to send notifications for when stuff like downloading is done.' - />

- await copyToClipboard(`v${version}`, notificationsAllowed) - } + onClick={async () => await copyToClipboard(`v${version}`)} title='The current launcher version.' > v{version} diff --git a/src/lib/clipboard.ts b/src/lib/clipboard.ts index 3a8d4af..5814daf 100644 --- a/src/lib/clipboard.ts +++ b/src/lib/clipboard.ts @@ -1,11 +1,7 @@ import { writeText } from '@tauri-apps/plugin-clipboard-manager' import { notifyUser } from './notifications' -export async function copyToClipboard ( - text: string, - notificationsAllowed: boolean -) { +export async function copyToClipboard (text: string) { await writeText(text) - if (notificationsAllowed) - await notifyUser('Copied', 'Text "' + text + '" copied to clipboard') + await notifyUser('Copied', 'Text "' + text + '" copied to clipboard') } diff --git a/src/popups/Downloads.tsx b/src/popups/Downloads.tsx index 7e8dbc8..646fe5d 100644 --- a/src/popups/Downloads.tsx +++ b/src/popups/Downloads.tsx @@ -19,7 +19,6 @@ export default function DownloadsPopup () { setDownloadProgress, downloadQueue, setDownloadQueue, - notificationsAllowed, versionsList, modsList, versions, @@ -117,15 +116,14 @@ export default function DownloadsPopup () { : d ) ) - if (notificationsAllowed) - await notifyUser( - 'Download Failed', - `The download for version ${ - serverVersionList?.versions.find( - vf => vf.id == v.version - )?.displayName - } has failed.` - ) + await notifyUser( + 'Download Failed', + `The download for version ${ + serverVersionList?.versions.find( + vf => vf.id == v.version + )?.displayName + } has failed.` + ) await getCurrentWindow().requestUserAttention( UserAttentionType.Critical ) diff --git a/src/providers/GlobalProvider.tsx b/src/providers/GlobalProvider.tsx index 972cfe2..ab33d32 100644 --- a/src/providers/GlobalProvider.tsx +++ b/src/providers/GlobalProvider.tsx @@ -53,7 +53,6 @@ type GlobalCtxType = { settings: Store | null versions: Store | null account: Store | null - notificationsAllowed: boolean sidebarAlwaysShowGames: boolean linuxUseWine: boolean linuxWineCommand: string