Remove allow notifications setting, it can be handled natively

This commit is contained in:
Lncvrt committed 2026-05-08 17:40:49 -07:00
1 parent 68864356b1
commit 3cc7257923
5 files changed
+3 -39

No files matched your search

+1 -19
View File
@@ -88,8 +88,6 @@ export default function RootLayout ({
const [versions, setVersions] = useState<Store | null>(null)
const [account, setAccount] = useState<Store | null>(null)
const [notificationsAllowed, setNotificationsAllowed] =
useState<boolean>(false)
const [sidebarAlwaysShowGames, setSidebarAlwaysShowGames] =
useState<boolean>(false)
const [linuxUseWine, setLinuxUseWine] = useState<boolean>(false)
@@ -232,7 +230,6 @@ export default function RootLayout ({
: d
)
)
if (await settings?.get<boolean>('notificationsAllowed'))
await notifyUser(
'Download Failed',
`The download for version ${info.displayName} has failed.`
@@ -311,7 +308,6 @@ export default function RootLayout ({
: d
)
)
if (await settings?.get<boolean>('notificationsAllowed'))
await notifyUser(
'Download Failed',
`The download for version ${info.displayName} has failed.`
@@ -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 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<string>('theme', v => setTheme(v ?? 'dark'))
watchSettings<boolean>('notificationsAllowed', v =>
setNotificationsAllowed(v ?? true)
)
watchSettings<boolean>('sidebarAlwaysShowGames', v =>
setSidebarAlwaysShowGames(v ?? true)
)
@@ -896,7 +879,6 @@ export default function RootLayout ({
settings,
versions,
account,
notificationsAllowed,
sidebarAlwaysShowGames,
linuxUseWine,
linuxWineCommand,
+1 -12
View File
@@ -18,7 +18,6 @@ export default function Settings () {
account,
version,
versionsList,
notificationsAllowed,
sidebarAlwaysShowGames,
linuxUseWine,
linuxWineCommand,
@@ -33,14 +32,6 @@ export default function Settings () {
<p className='text-3xl ml-4 mt-4'>Settings</p>
<div className='flex flex-row p-4 gap-4'>
<div className='bg-(--col1) border border-(--col3) rounded-lg p-4 w-fit h-fit'>
<Setting
label='Allow sending notifications'
value={notificationsAllowed}
onChange={async () => {
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.'
/>
<Setting
label='Always show games in sidebar'
value={sidebarAlwaysShowGames}
@@ -290,9 +281,7 @@ export default function Settings () {
</div>
<p
className='fixed bottom-1.5 right-1.5 rounded-md cursor-pointer px-1 border z-100 transition-colors btntheme1'
onClick={async () =>
await copyToClipboard(`v${version}`, notificationsAllowed)
}
onClick={async () => await copyToClipboard(`v${version}`)}
title='The current launcher version.'
>
v{version}
+1 -5
View File
@@ -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')
}
-2
View File
@@ -19,7 +19,6 @@ export default function DownloadsPopup () {
setDownloadProgress,
downloadQueue,
setDownloadQueue,
notificationsAllowed,
versionsList,
modsList,
versions,
@@ -117,7 +116,6 @@ export default function DownloadsPopup () {
: d
)
)
if (notificationsAllowed)
await notifyUser(
'Download Failed',
`The download for version ${
-1
View File
@@ -53,7 +53,6 @@ type GlobalCtxType = {
settings: Store | null
versions: Store | null
account: Store | null
notificationsAllowed: boolean
sidebarAlwaysShowGames: boolean
linuxUseWine: boolean
linuxWineCommand: string